From dbc9ae5386abaff8e4c8ce06f1c037a575d34d7e Mon Sep 17 00:00:00 2001 From: Blank Date: Wed, 29 Jul 2026 15:32:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(tests):=20=E6=B6=88=E9=99=A4=20DisposableCo?= =?UTF-8?q?ncurrentDictionaryTests=20=E7=9A=84=20Sonar=20S2699=20=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=E6=96=AD=E8=A8=80=E8=BF=9D=E8=A7=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linear: GFX-188 --- .../Extensions/DisposableConcurrentDictionaryTests.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/GameFrameX.Foundation.Tests/Extensions/DisposableConcurrentDictionaryTests.cs b/GameFrameX.Foundation.Tests/Extensions/DisposableConcurrentDictionaryTests.cs index 797cc79..1e19222 100644 --- a/GameFrameX.Foundation.Tests/Extensions/DisposableConcurrentDictionaryTests.cs +++ b/GameFrameX.Foundation.Tests/Extensions/DisposableConcurrentDictionaryTests.cs @@ -192,8 +192,12 @@ public void Dispose_EmptyDictionary_ShouldNotThrow() // Arrange var dictionary = new DisposableConcurrentDictionary(); - // Act & Assert - dictionary.Dispose(); // Should not throw + // Act + var exception = Record.Exception(() => dictionary.Dispose()); + + // Assert + Assert.Null(exception); // Should not throw + Assert.True(dictionary.IsDisposed); } [Fact]