Skip to content

Commit 90310c2

Browse files
committed
test: 增加单元测试
1 parent 035e7ac commit 90310c2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/UnitTest/Components/AjaxTest.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ public async Task Ajax_Test()
1414
{
1515
Url = "/api/Login",
1616
Method = "POST",
17-
Data = new { UserName = "admin", Password = "1234567" },
18-
ToJson = false
17+
Data = new { UserName = "admin", Password = "1234567" }
1918
};
2019
Assert.Equal("/api/Login", option.Url);
2120
Assert.Equal("POST", option.Method);
22-
Assert.False(option.ToJson);
21+
Assert.True(option.ToJson);
2322
Assert.NotNull(option.Data);
2423

24+
option.ToJson = false;
25+
Assert.False(option.ToJson);
26+
2527
var service = Context.Services.GetRequiredService<AjaxService>();
2628
await service.InvokeAsync(option);
2729
}

0 commit comments

Comments
 (0)