From ee3f8c97dfc5f6f5520a63abe74e98f78902020c Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Wed, 25 Feb 2026 17:23:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(tests):=20=E4=BF=AE=E6=AD=A3=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E6=89=A9=E5=B1=95=E6=B5=8B=E8=AF=95=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E7=B1=BB=E5=9E=8B=E6=96=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 OperationCanceledException 替换为 TaskCanceledException 进行正确的异常断言 --- GFramework.Core.Tests/extensions/AsyncExtensionsTests.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/GFramework.Core.Tests/extensions/AsyncExtensionsTests.cs b/GFramework.Core.Tests/extensions/AsyncExtensionsTests.cs index b673667..7a0d80b 100644 --- a/GFramework.Core.Tests/extensions/AsyncExtensionsTests.cs +++ b/GFramework.Core.Tests/extensions/AsyncExtensionsTests.cs @@ -42,9 +42,8 @@ public class AsyncExtensionsTests // Arrange using var cts = new CancellationTokenSource(); cts.Cancel(); - // Act & Assert - Assert.ThrowsAsync(async () => + Assert.ThrowsAsync(async () => await AsyncExtensions.WithTimeout( async ct => {