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.

55 lines
1.6 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. using Shentun.Peis.GuideTypes;
  2. using Shouldly;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using Volo.Abp.Application.Dtos;
  9. using Xunit;
  10. using Xunit.Abstractions;
  11. namespace Shentun.Peis
  12. {
  13. public class GuideTypeAppServiceTest: PeisApplicationTestBase
  14. {
  15. private readonly GuideTypeAppService _guideTypeAppService;
  16. private readonly ITestOutputHelper _testOutputHelper;
  17. public GuideTypeAppServiceTest(ITestOutputHelper testOutputHelper)
  18. {
  19. _testOutputHelper = testOutputHelper;
  20. _guideTypeAppService = GetRequiredService<GuideTypeAppService>();
  21. }
  22. [Fact]
  23. public async Task GetList()
  24. {
  25. PagedAndSortedResultRequestDto qc = new PagedAndSortedResultRequestDto() {
  26. Sorting = "displayorder"};
  27. var result = await _guideTypeAppService.GetListAsync(qc);
  28. result.TotalCount.ShouldBeGreaterThanOrEqualTo(4);
  29. Console.WriteLine(result.TotalCount);
  30. _testOutputHelper.WriteLine(result.TotalCount.ToString());
  31. foreach (var item in result.Items)
  32. {
  33. Console.WriteLine(item.DisplayName);
  34. _testOutputHelper.WriteLine(item.DisplayName);
  35. }
  36. }
  37. [Fact]
  38. public async Task Create()
  39. {
  40. var result = await _guideTypeAppService.CreateAsync(new CreateGuideTypeDto()
  41. {
  42. DisplayName = "Foo",
  43. });
  44. _testOutputHelper.WriteLine(result.Id.ToString());
  45. }
  46. }
  47. }