ApiServiceTest.cs 685 B

1234567891011121314151617181920212223242526272829303132
  1. using Xunit;
  2. using ZhonTai.Admin.Services.Api;
  3. using ZhonTai.Admin.Tools.Captcha;
  4. namespace ZhonTai.Tests.Services;
  5. public class ApiServiceTest : BaseTest
  6. {
  7. private readonly IApiService _apiService;
  8. private readonly ICaptchaTool _captchaTool;
  9. public ApiServiceTest()
  10. {
  11. _apiService = GetService<IApiService>();
  12. _captchaTool = GetService<ICaptchaTool>(); ;
  13. }
  14. [Fact]
  15. public async void SlideJigsawTest()
  16. {
  17. var data = await _captchaTool.GetAsync("admin:captcha");
  18. }
  19. [Fact]
  20. public async void GetAsync()
  21. {
  22. var res = await _apiService.GetAsync(161227168079941);
  23. Assert.True(res?.Id > 0);
  24. }
  25. }