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.
|
|
using Shentun.WebPeis.AppointPatientRegisters;using Shentun.WebPeis.AppointSchedules;using Shentun.WebPeis.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.Modularity;using Volo.Abp.Uow;using Xunit;using Xunit.Abstractions;
namespace Shentun.WebPeis{ public class AppointScheduleAppServiceTest<TStartupModule> : WebPeisApplicationTestBase<TStartupModule> where TStartupModule : IAbpModule { private readonly IRepository<AppointSchedule> _repository; private readonly AppointScheduleAppService _appService; private readonly ITestOutputHelper _output; private readonly IUnitOfWorkManager _unitOfWorkManager; public AppointScheduleAppServiceTest(ITestOutputHelper output) { _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>(); _repository = GetRequiredService<IRepository<AppointSchedule>>(); _appService = GetRequiredService<AppointScheduleAppService>(); _output = output; }
[Fact] public async Task GetAppointScheduleDateListAsync() { using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) {
var entity = new GetAppointScheduleDateListInputDto() { MedicalCenterId = new Guid("150da355-dfbf-466b-9697-355836a862c4") }; var list = await _appService.GetAppointScheduleDateListAsync(entity); foreach (var item in list) { _output.WriteLine(item.AppointDate.ToString()); } await unitOfWork.CompleteAsync(); } }
[Fact] public async Task GetAppointScheduleTimeListByIdAsync() { using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) {
var entity = new AppointScheduleIdInputDto() { AppointScheduleId = new Guid("3a12ec2e-a9dc-554c-e90a-7ac4f503819a") }; var list = await _appService.GetAppointScheduleTimeListByIdAsync(entity); foreach (var item in list) { _output.WriteLine(item.StartTime + "-" + item.StartTime + ":"+ item.CanAppointNumber.ToString());
} await unitOfWork.CompleteAsync(); } }
[Fact] public async Task GetAppointScheduleDateListNoMedicalCenterAsync() { using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) {
var entity = new MedicalCenterIdInputDto() { // MedicalCenterId = new Guid("150da355-dfbf-466b-9697-355836a862c4")
}; var list = await _appService.GetAppointScheduleDateListAsync(null); foreach (var item in list) { _output.WriteLine(item.AppointDate.ToString());
} await unitOfWork.CompleteAsync(); } } }}
|