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.

64 lines
1.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. using Shentun.Peis.CustomerOrgs;
  2. using Shentun.Peis.GuideTypes;
  3. using Shentun.Peis.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.Uow;
  11. using Xunit;
  12. using Xunit.Abstractions;
  13. namespace Shentun.Peis
  14. {
  15. public class CustomerOrgAppServiceTest : PeisApplicationTestBase
  16. {
  17. private readonly IRepository<CustomerOrg, Guid> _repository;
  18. private readonly CustomerOrgAppService _appService;
  19. private readonly ITestOutputHelper _output;
  20. private readonly IUnitOfWorkManager _unitOfWorkManager;
  21. public CustomerOrgAppServiceTest(ITestOutputHelper testOutputHelper)
  22. {
  23. _output = testOutputHelper;
  24. _unitOfWorkManager = GetRequiredService<IUnitOfWorkManager>();
  25. _repository = GetRequiredService<IRepository<CustomerOrg, Guid>>();
  26. _appService = GetRequiredService<CustomerOrgAppService>();
  27. }
  28. [Fact]
  29. public async Task CreateAsync()
  30. {
  31. var result = await _appService.CreateAsync(new CreateCustomerOrgDto()
  32. {
  33. MedicalCenterId = new Guid("68f2d834-2bf0-4978-ad54-d2133c12a333"),
  34. ParentId = new Guid("3a0c5101-a6a6-e48a-36ec-33e7567a99e6"),
  35. DisplayName = "Foo",
  36. ShortName = "Bar",
  37. OrgTypeId = new Guid("3a0c5100-9a4e-243b-cd63-e0b0391623dd"),
  38. IsActive = 'N',
  39. IsLock = 'N'
  40. }); ;
  41. _output.WriteLine(result.Id.ToString());
  42. }
  43. [Fact]
  44. public async Task GetByCodeAllAsync()
  45. {
  46. var list = await _appService.GetByCodeAllAsync("",0);
  47. foreach (var item in list)
  48. {
  49. _output.WriteLine(item.DisplayName);
  50. }
  51. }
  52. }
  53. }