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.

47 lines
1.7 KiB

2 years ago
  1. using Shentun.Peis.CustomerOrgs;
  2. using Shentun.Peis.Models;
  3. using Shentun.Peis.PatientRegisters;
  4. using Shentun.Peis.PrintReports;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  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 PrintReportAppServiceTest : PeisApplicationTestBase
  17. {
  18. private readonly IRepository<CustomerOrg, Guid> _repository;
  19. private readonly PrintReportAppService _appService;
  20. private readonly ITestOutputHelper _output;
  21. private readonly IUnitOfWorkManager _unitOfWorkManager;
  22. public PrintReportAppServiceTest(ITestOutputHelper testOutputHelper)
  23. {
  24. _output = testOutputHelper;
  25. _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
  26. _repository = GetRequiredService<IRepository<CustomerOrg, Guid>>();
  27. _appService = GetRequiredService<PrintReportAppService>();
  28. }
  29. [Fact]
  30. public async Task GetLisRequestReportAsync()
  31. {
  32. using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
  33. {
  34. var items = await _appService.GetLisRequestReportAsync(new Guid("3a11ee70-02cb-c5e6-a087-79ecdd0356b6"));
  35. _output.WriteLine(items.Count().ToString());
  36. foreach (var item in items)
  37. {
  38. _output.WriteLine(item.PatientName + "," + item.CustomerOrgName + "," +
  39. item.DepartmentName + item.AsbitemName);
  40. }
  41. await unitOfWork.CompleteAsync();
  42. }
  43. }
  44. }
  45. }