mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-05-02 19:12:51 +08:00
31 lines
1019 B
C#
31 lines
1019 B
C#
using NetAdmin.Domain.Dto.Sys.Captcha;
|
|
|
|
namespace NetAdmin.SysComponent.Tests.Sys;
|
|
|
|
/// <summary>
|
|
/// 人机验证测试
|
|
/// </summary>
|
|
[SuppressMessage("Usage", "xUnit1026:Theory methods should use all of their parameters")]
|
|
[SuppressMessage("Usage", "xUnit1028:Test method must have valid return type")]
|
|
public class CaptchaTests(WebTestApplicationFactory<Startup> factory, ITestOutputHelper testOutputHelper)
|
|
: WebApiTestBase<Startup>(factory, testOutputHelper), ICaptchaModule
|
|
{
|
|
/// <inheritdoc />
|
|
[Fact]
|
|
public async Task<GetCaptchaRsp> GetCaptchaImageAsync()
|
|
{
|
|
var rsp = await PostJsonAsync(typeof(CaptchaController));
|
|
Assert.True(rsp.IsSuccessStatusCode);
|
|
return default;
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
[InlineData(default)]
|
|
[Theory]
|
|
public async Task<bool> VerifyCaptchaAsync(VerifyCaptchaReq req)
|
|
{
|
|
var rsp = await PostJsonAsync(typeof(CaptchaController), req);
|
|
Assert.True(rsp.IsSuccessStatusCode);
|
|
return default;
|
|
}
|
|
} |