Skip to content

Commit

Permalink
test: 更新单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
ArgoZhang committed Feb 3, 2025
1 parent df965b1 commit 63af32a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/UnitTest/Services/WebClientServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,17 @@ public async Task WebClientOptions_Ok()
}

[Fact]
public async Task Timeout_Ok()
public async Task GetClientInfo_Error()
{
var service = Context.Services.GetRequiredService<WebClientService>();
var client = await service.GetClientInfo();

// TimeoutException
Assert.Null(client.Ip);

// Exception
Context.JSInterop.SetupVoid("ping", _ => true).SetException(new Exception("test-exception"));
client = await service.GetClientInfo();
}

[Fact]
Expand Down

0 comments on commit 63af32a

Please sign in to comment.