From 63af32a5062929d2be642a90919d0bedfc722bc6 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 3 Feb 2025 08:42:24 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=9B=B4=E6=96=B0=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/UnitTest/Services/WebClientServiceTest.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/UnitTest/Services/WebClientServiceTest.cs b/test/UnitTest/Services/WebClientServiceTest.cs index 6d7bf64861a..35ff8cdcb36 100644 --- a/test/UnitTest/Services/WebClientServiceTest.cs +++ b/test/UnitTest/Services/WebClientServiceTest.cs @@ -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(); 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]