Skip to content

Commit 63af32a

Browse files
committed
test: 更新单元测试
1 parent df965b1 commit 63af32a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/UnitTest/Services/WebClientServiceTest.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,17 @@ public async Task WebClientOptions_Ok()
5959
}
6060

6161
[Fact]
62-
public async Task Timeout_Ok()
62+
public async Task GetClientInfo_Error()
6363
{
6464
var service = Context.Services.GetRequiredService<WebClientService>();
6565
var client = await service.GetClientInfo();
66+
67+
// TimeoutException
6668
Assert.Null(client.Ip);
69+
70+
// Exception
71+
Context.JSInterop.SetupVoid("ping", _ => true).SetException(new Exception("test-exception"));
72+
client = await service.GetClientInfo();
6773
}
6874

6975
[Fact]

0 commit comments

Comments
 (0)