5 changed files with 106 additions and 3 deletions
-
5src/Shentun.WebPeis.Application.Contracts/AppointScheduleTimes/AppointScheduleTimeDto.cs
-
1src/Shentun.WebPeis.Application/AppointScheduleTimes/AppointScheduleTimeAppService.cs
-
36src/Shentun.WebPeis.Application/AppointSchedules/AppointScheduleAppService.cs
-
53test/Shentun.WebPeis.Application.Tests/AppointScheduleAppServiceTest.cs
-
14test/Shentun.WebPeis.EntityFrameworkCore.Tests/EntityFrameworkCore/Applications/EfCoreAppointScheduleAppServiceTest.cs
@ -0,0 +1,53 @@ |
|||
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 MedicalCenterIdInputDto() |
|||
{ |
|||
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(); |
|||
} |
|||
} |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Xunit.Abstractions; |
|||
|
|||
namespace Shentun.WebPeis.EntityFrameworkCore.Applications |
|||
{ |
|||
public class EfCoreAppointScheduleAppServiceTest : AppointScheduleAppServiceTest<WebPeisEntityFrameworkCoreTestModule> |
|||
{ |
|||
public EfCoreAppointScheduleAppServiceTest(ITestOutputHelper output) : base(output) { } |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue