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.

71 lines
2.6 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. using Shentun.Peis.ChargeRequests;
  2. using Shentun.Peis.ImportLisResults;
  3. using Shentun.Peis.Models;
  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.Domain.Repositories;
  10. using Volo.Abp.Uow;
  11. using Xunit;
  12. using Xunit.Abstractions;
  13. namespace Shentun.Peis
  14. {
  15. public class ImportLisResultAppServiceTest : PeisApplicationTestBase
  16. {
  17. private readonly IRepository<ImportLisResult> _repository;
  18. private readonly ImportLisResultAppService _appService;
  19. private readonly ITestOutputHelper _output;
  20. private readonly IUnitOfWorkManager _unitOfWorkManager;
  21. public ImportLisResultAppServiceTest(ITestOutputHelper testOutputHelper)
  22. {
  23. _output = testOutputHelper;
  24. _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
  25. _repository = GetRequiredService<IRepository<ImportLisResult>>();
  26. _appService = GetRequiredService<ImportLisResultAppService>();
  27. }
  28. [Fact]
  29. public async Task ImportResultAsync()
  30. {
  31. using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
  32. {
  33. var entity = new List<CreateImportLisResultDto>()
  34. {
  35. new CreateImportLisResultDto()
  36. {
  37. LisRequestNo = "2405100389",
  38. ItemId = new Guid("3a126b34-dc65-fba2-49ed-40413c36babb"),
  39. Result = "阴性",
  40. //Unit = "g/l",
  41. //ReferenceRangeValue = "0~20"
  42. CheckDoctorName = "测试"
  43. },
  44. new CreateImportLisResultDto()
  45. {
  46. LisRequestNo = "2405100389",
  47. ItemId = new Guid("3a126b34-dc9b-8893-ddf3-a4e05044145b"),
  48. Result = "阴性",
  49. //Unit = "ml",
  50. //ReferenceRangeValue = "10~50"
  51. CheckDoctorName = "测试"
  52. },
  53. new CreateImportLisResultDto()
  54. {
  55. LisRequestNo = "2405100389",
  56. ItemId = new Guid("3a126b34-dcda-b371-a13f-9f1efba0ee27"),
  57. Result = "阴性",
  58. //Unit = "次",
  59. //ReferenceRangeValue = "10~60"
  60. CheckDoctorName = "测试"
  61. }
  62. };
  63. await _appService.ImportResultAsync(entity);
  64. await unitOfWork.CompleteAsync();
  65. }
  66. }
  67. }
  68. }