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 _repository; private readonly AppointPatientRegisterAppService _appService; private readonly ITestOutputHelper _output; private readonly IUnitOfWorkManager _unitOfWorkManager; public AppointPatientRegisterAppServiceTest(ITestOutputHelper testOutputHelper) { _output = testOutputHelper; _unitOfWorkManager = GetRequiredService(); _repository = GetRequiredService>(); _appService = GetRequiredService(); } [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> ("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(); } } } }