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.

98 lines
3.8 KiB

using Shentun.Peis.DiagnosisFunctions;
using Shentun.Peis.Models;
using Shentun.Peis.RegisterAsbitems;
using Shentun.Peis.RegisterChecks;
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 RegisterCheckAppServiceTest : PeisApplicationTestBase
{
private readonly IRepository<RegisterCheck> _repository;
private readonly RegisterCheckAppService _appService;
private readonly ITestOutputHelper _output;
private readonly IUnitOfWorkManager _unitOfWorkManager;
public RegisterCheckAppServiceTest(ITestOutputHelper testOutputHelper)
{
_output = testOutputHelper;
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
_repository = GetRequiredService<IRepository<RegisterCheck>>();
_appService = GetRequiredService<RegisterCheckAppService>();
}
[Fact]
public async Task UpdateCheckResult()
{
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
{
var updateCheckResultDto = new UpdateCheckResultDto()
{
RegisterCheckId = new Guid("3a123c55-07ad-f46e-8f6a-4c3b8c8a78de"),
// CheckDoctorId = "王医生",
CheckDate = new DateTime(2022,1,1),
RegisterCheckItems = new List<UpdateRegisterCheckItemDetail>
{
new UpdateRegisterCheckItemDetail()
{
ItemId = new Guid("3a1203c2-6bcd-5490-19af-4663293fddd8"),
Result = "未见异常"
},
new UpdateRegisterCheckItemDetail()
{
ItemId = new Guid("3a1203c2-6c55-b07a-79cd-bec4e231390b"),
Result = "未见异常"
},
//new UpdateRegisterCheckItemDetail()
//{
// ItemId = new Guid("3a0c655a-1fdc-2447-6dc9-d8ec8e110d2e"),
// Result = "阳性"
//},
//new UpdateRegisterCheckItemDetail()
//{
// ItemId = new Guid("3a0c655c-1c9f-c8c5-150a-59b3cc351472"),
// Result = "阴性"
//},
//new UpdateRegisterCheckItemDetail()
//{
// ItemId = new Guid("3a0c655d-6ab7-ca7e-3920-3b493ec83192"),
// Result = "阳性"
//},
},
Summarys = new List<UpdateRegisterCheckSummaryDetail>()
{
new UpdateRegisterCheckSummaryDetail()
{
Summary = "dsfdsfdsfdsfdsf"
},
new UpdateRegisterCheckSummaryDetail()
{
Summary = "ddddddd"
}
},
Suggestions = new List<UpdateRegisterCheckSuggestionDetail>() { new UpdateRegisterCheckSuggestionDetail()
{
Suggestion = "dddd"
},
new UpdateRegisterCheckSuggestionDetail()
{
Suggestion = "sssss"
}
}
};
await _appService.UpdateCheckResult(updateCheckResultDto);
await unitOfWork.CompleteAsync();
}
}
}
}