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.

56 lines
1.7 KiB

2 years ago
  1. using Shentun.Peis.GuideTypes;
  2. using Shentun.Peis.Models;
  3. using Shentun.Peis.Patients;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using Volo.Abp.Application.Dtos;
  10. using Volo.Abp.Domain.Repositories;
  11. using Volo.Abp.Uow;
  12. using Xunit;
  13. using Xunit.Abstractions;
  14. namespace Shentun.Peis
  15. {
  16. public class PatientAppServiceTest : PeisApplicationTestBase
  17. {
  18. private readonly IRepository<Patient, Guid> _repository;
  19. private readonly PatientAppService _appService;
  20. private readonly ITestOutputHelper _output;
  21. private readonly IUnitOfWorkManager _unitOfWorkManager;
  22. public PatientAppServiceTest(ITestOutputHelper testOutputHelper)
  23. {
  24. _output = testOutputHelper;
  25. _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
  26. _repository = GetRequiredService<IRepository<Patient, Guid>>();
  27. _appService = GetRequiredService<PatientAppService>();
  28. }
  29. [Fact]
  30. public async Task GetListInFilterAsync()
  31. {
  32. using (var uow = _unitOfWorkManager.Begin())
  33. {
  34. GetListInFilterDto qc = new GetListInFilterDto()
  35. {
  36. Sorting = "displayorder"
  37. };
  38. var result = await _appService.GetListInFilterAsync(qc);
  39. _output.WriteLine(result.TotalCount.ToString());
  40. foreach (var item in result.Items)
  41. {
  42. Console.WriteLine(item.DisplayName);
  43. _output.WriteLine(item.DisplayName);
  44. }
  45. }
  46. }
  47. }
  48. }