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.

71 lines
2.4 KiB

1 year ago
  1. using Shentun.Peis.OrganizationUnits;
  2. using Shentun.WebPeis.MedicalPackages;
  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 MedicalPackageAppServiceTestt<TStartupModule> : WebPeisApplicationTestBase<TStartupModule>
  17. where TStartupModule : IAbpModule
  18. {
  19. private readonly IRepository<MedicalPackage> _repository;
  20. private readonly MedicalPackageAppService _appService;
  21. private readonly ITestOutputHelper _output;
  22. private readonly IUnitOfWorkManager _unitOfWorkManager;
  23. public MedicalPackageAppServiceTestt(ITestOutputHelper output)
  24. {
  25. _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
  26. _repository = GetRequiredService<IRepository<MedicalPackage>>();
  27. _appService = GetRequiredService<MedicalPackageAppService>();
  28. _output = output;
  29. }
  30. [Fact]
  31. public async Task GetCanAppointListAsync()
  32. {
  33. using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
  34. {
  35. var list = await _appService.GetCanAppointListAsync();
  36. foreach (var item in list)
  37. {
  38. _output.WriteLine(item.MedicalPackageName);
  39. }
  40. await unitOfWork.CompleteAsync();
  41. }
  42. }
  43. [Fact]
  44. public async Task GetCheckTypeWithAsbitemsListByMedicalPackageIdAsync()
  45. {
  46. using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
  47. {
  48. var list = await _appService.GetCheckTypeWithAsbitemsListByMedicalPackageIdAsync(new MedicalPackageIdInput()
  49. {
  50. MedicalPackageId = new Guid("3a126b35-42a3-d38f-02fc-3c42734c28f7")
  51. });
  52. foreach (var item in list)
  53. {
  54. _output.WriteLine("-----------"+ item.CheckTypeFlagName);
  55. foreach(var asbitem in item.Asbitems)
  56. {
  57. _output.WriteLine(asbitem.AsbitemName);
  58. }
  59. }
  60. await unitOfWork.CompleteAsync();
  61. }
  62. }
  63. }
  64. }