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.

87 lines
3.1 KiB

2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
  1. using Shentun.Peis.ChargeRequests;
  2. using Shentun.Peis.ImportLisResults;
  3. using Shentun.Peis.Models;
  4. using Shentun.Peis.PatientRegisters;
  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 ImportLisResultAppServiceTest : PeisApplicationTestBase
  17. {
  18. private readonly IRepository<ImportLisResult> _repository;
  19. private readonly ImportLisResultAppService _appService;
  20. private readonly ITestOutputHelper _output;
  21. private readonly IUnitOfWorkManager _unitOfWorkManager;
  22. public ImportLisResultAppServiceTest(ITestOutputHelper testOutputHelper)
  23. {
  24. _output = testOutputHelper;
  25. _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
  26. _repository = GetRequiredService<IRepository<ImportLisResult>>();
  27. _appService = GetRequiredService<ImportLisResultAppService>();
  28. }
  29. [Fact]
  30. public async Task ImportResultAsync()
  31. {
  32. using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
  33. {
  34. var entity = new List<CreateImportLisResultDto>()
  35. {
  36. new CreateImportLisResultDto()
  37. {
  38. LisRequestNo = "2405100389",
  39. ItemId = new Guid("3a126b34-dc65-fba2-49ed-40413c36babb"),
  40. Result = "阴性",
  41. //Unit = "g/l",
  42. //ReferenceRangeValue = "0~20"
  43. CheckDoctorName = "测试"
  44. },
  45. new CreateImportLisResultDto()
  46. {
  47. LisRequestNo = "2405100389",
  48. ItemId = new Guid("3a126b34-dc9b-8893-ddf3-a4e05044145b"),
  49. Result = "阴性",
  50. //Unit = "ml",
  51. //ReferenceRangeValue = "10~50"
  52. CheckDoctorName = "测试"
  53. },
  54. new CreateImportLisResultDto()
  55. {
  56. LisRequestNo = "2405100389",
  57. ItemId = new Guid("3a126b34-dcda-b371-a13f-9f1efba0ee27"),
  58. Result = "阴性",
  59. //Unit = "次",
  60. //ReferenceRangeValue = "10~60"
  61. CheckDoctorName = "测试"
  62. }
  63. };
  64. await _appService.ImportResultAsync(entity);
  65. await unitOfWork.CompleteAsync();
  66. }
  67. }
  68. [Fact]
  69. public async Task ImportResultByPatientRegisterIdAsync()
  70. {
  71. using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
  72. {
  73. await _appService.ImportResultByPatientRegisterIdAsync(new PatientRegisterIdInputDto()
  74. {
  75. PatientRegisterId = new Guid("3a127c60-bf8f-e6d9-9db0-817d217e0ff1")
  76. });
  77. await unitOfWork.CompleteAsync();
  78. }
  79. }
  80. }
  81. }