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.
68 lines
2.5 KiB
68 lines
2.5 KiB
using Shentun.Peis.ChargeRequests;
|
|
using Shentun.Peis.ImportLisResults;
|
|
using Shentun.Peis.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Volo.Abp.Domain.Repositories;
|
|
using Volo.Abp.Uow;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Shentun.Peis
|
|
{
|
|
public class ImportLisResultAppServiceTest : PeisApplicationTestBase
|
|
{
|
|
private readonly IRepository<ImportLisResult> _repository;
|
|
private readonly ImportLisResultAppService _appService;
|
|
private readonly ITestOutputHelper _output;
|
|
private readonly IUnitOfWorkManager _unitOfWorkManager;
|
|
public ImportLisResultAppServiceTest(ITestOutputHelper testOutputHelper)
|
|
{
|
|
_output = testOutputHelper;
|
|
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
|
|
_repository = GetRequiredService<IRepository<ImportLisResult>>();
|
|
_appService = GetRequiredService<ImportLisResultAppService>();
|
|
}
|
|
[Fact]
|
|
public async Task ImportResultAsync()
|
|
{
|
|
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
|
|
{
|
|
|
|
var entity = new List<CreateImportLisResultDto>()
|
|
{
|
|
new CreateImportLisResultDto()
|
|
{
|
|
LisRequestNo = "T202404290063",
|
|
ItemId = new Guid("3a1203c2-c974-de89-ee07-3427f22fa8f7"),
|
|
Result = "32",
|
|
Unit = "g/l",
|
|
ReferenceRangeValue = "0-20"
|
|
},
|
|
new CreateImportLisResultDto()
|
|
{
|
|
LisRequestNo = "T202404290063",
|
|
ItemId = new Guid("3a1203c2-ccd1-e29b-84b4-26bd28bbe12e"),
|
|
Result = "51.63",
|
|
Unit = "ml",
|
|
ReferenceRangeValue = "0-20"
|
|
},
|
|
new CreateImportLisResultDto()
|
|
{
|
|
LisRequestNo = "T202404290063",
|
|
ItemId = new Guid("3a1203c2-d3b1-61fe-94e9-1210fd5555ec"),
|
|
Result = "123.001",
|
|
Unit = "次",
|
|
ReferenceRangeValue = "0-20"
|
|
}
|
|
};
|
|
|
|
await _appService.ImportResultAsync(entity);
|
|
await unitOfWork.CompleteAsync();
|
|
}
|
|
}
|
|
}
|
|
}
|