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.
81 lines
3.0 KiB
81 lines
3.0 KiB
using Shentun.Peis.AppointPatientRegisters;
|
|
using Shentun.Peis.ChargeRequests;
|
|
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 AppointPatientRegisterAppServiceTest : PeisApplicationTestBase
|
|
{
|
|
private readonly IRepository<ChargeRequest, Guid> _repository;
|
|
private readonly AppointPatientRegisterAppService _appService;
|
|
private readonly ITestOutputHelper _output;
|
|
private readonly IUnitOfWorkManager _unitOfWorkManager;
|
|
public AppointPatientRegisterAppServiceTest(ITestOutputHelper testOutputHelper)
|
|
{
|
|
_output = testOutputHelper;
|
|
_unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
|
|
_repository = GetRequiredService<IRepository<ChargeRequest, Guid>>();
|
|
_appService = GetRequiredService<AppointPatientRegisterAppService>();
|
|
}
|
|
|
|
[Fact]
|
|
public async Task GetListByFilterAsync()
|
|
{
|
|
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
|
|
{
|
|
|
|
var entity = new AppointPatientRegisterInputDto()
|
|
{
|
|
ThirdInterFaceId = new Guid("43a9c3a5-8741-4c64-b869-bc304712d88e"),
|
|
AppointStartDate = DateTime.Now.Date.AddDays(-10),
|
|
MobilePhone = "18911254911"
|
|
|
|
};
|
|
|
|
var newEntity = await _appService.GetListByFilterAsync(entity);
|
|
foreach (var item in newEntity)
|
|
{
|
|
_output.WriteLine(item.PersonName);
|
|
}
|
|
await unitOfWork.CompleteAsync();
|
|
}
|
|
}
|
|
[Fact]
|
|
public async Task GetListByFilterAsync2()
|
|
{
|
|
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
|
|
{
|
|
|
|
var entity = new AppointPatientRegisterInputDto()
|
|
{
|
|
ThirdInterFaceId = new Guid("43a9c3a5-8741-4c64-b869-bc304712d88e"),
|
|
AppointStartDate = DateTime.Now.Date.AddDays(-10),
|
|
MobilePhone = "18911254911"
|
|
|
|
};
|
|
var appServiceHelper = new AppServiceHelper();
|
|
var list = await appServiceHelper.CallAppServiceAsync<AppointPatientRegisterInputDto, List<AppointPatientRegisterDto>>
|
|
("api/app/AppointPatientRegister/GetListByFilter", entity);
|
|
foreach(var item in list)
|
|
{
|
|
_output.WriteLine(item.PersonName);
|
|
}
|
|
//var newEntity = await _appService.GetListByFilterAsync(entity);
|
|
//foreach (var item in newEntity)
|
|
//{
|
|
// _output.WriteLine(item.PersonName);
|
|
//}
|
|
await unitOfWork.CompleteAsync();
|
|
}
|
|
}
|
|
}
|
|
}
|