You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

  1. using Microsoft.EntityFrameworkCore;
  2. using Shentun.Peis.GuideTypes;
  3. using Shentun.Peis.Models;
  4. using Shentun.Peis.Sexs;
  5. using Shouldly;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using Volo.Abp.Application.Dtos;
  12. using Volo.Abp.Domain.Repositories;
  13. using Volo.Abp.Uow;
  14. using Xunit;
  15. using Xunit.Abstractions;
  16. namespace Shentun.Peis
  17. {
  18. public class SexAppServiceTest:PeisApplicationTestBase
  19. {
  20. private readonly IRepository<Sex> _repository;
  21. private readonly SexAppService _appService;
  22. private readonly ITestOutputHelper _output;
  23. private readonly IUnitOfWorkManager _unitOfWorkManager;
  24. public SexAppServiceTest(ITestOutputHelper testOutputHelper)
  25. {
  26. _output = testOutputHelper;
  27. _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
  28. _repository = GetRequiredService<IRepository<Sex>>();
  29. _appService = GetRequiredService<SexAppService>();
  30. }
  31. [Fact]
  32. public async Task UpdateAsync()
  33. {
  34. var dto = new UpdateSexDto() {
  35. DisplayName = "未知",
  36. SimpleCode = "A",
  37. };
  38. try
  39. {
  40. await _appService.UpdateAsync('U', dto);
  41. }
  42. catch (Exception ex)
  43. {
  44. _output.WriteLine(ex.ToString());
  45. }
  46. }
  47. }
  48. }