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.

53 lines
1.8 KiB

1 year ago
  1. using Shentun.WebPeis.AppointPatientRegisters;
  2. using Shentun.WebPeis.AppointSchedules;
  3. using Shentun.WebPeis.Models;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using Volo.Abp.Domain.Repositories;
  10. using Volo.Abp.Modularity;
  11. using Volo.Abp.Uow;
  12. using Xunit;
  13. using Xunit.Abstractions;
  14. namespace Shentun.WebPeis
  15. {
  16. public class AppointScheduleAppServiceTest<TStartupModule> : WebPeisApplicationTestBase<TStartupModule>
  17. where TStartupModule : IAbpModule
  18. {
  19. private readonly IRepository<AppointSchedule> _repository;
  20. private readonly AppointScheduleAppService _appService;
  21. private readonly ITestOutputHelper _output;
  22. private readonly IUnitOfWorkManager _unitOfWorkManager;
  23. public AppointScheduleAppServiceTest(ITestOutputHelper output)
  24. {
  25. _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
  26. _repository = GetRequiredService<IRepository<AppointSchedule>>();
  27. _appService = GetRequiredService<AppointScheduleAppService>();
  28. _output = output;
  29. }
  30. [Fact]
  31. public async Task GetAppointScheduleDateListAsync()
  32. {
  33. using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
  34. {
  35. var entity = new MedicalCenterIdInputDto()
  36. {
  37. MedicalCenterId = new Guid("150da355-dfbf-466b-9697-355836a862c4")
  38. };
  39. var list = await _appService.GetAppointScheduleDateListAsync(entity);
  40. foreach (var item in list)
  41. {
  42. _output.WriteLine(item.AppointDate.ToString());
  43. }
  44. await unitOfWork.CompleteAsync();
  45. }
  46. }
  47. }
  48. }