From 39ff6e4b87b9d5e5d8ff431c15594f93b908fc1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Breu=C3=9F=20Valentin?= Date: Tue, 3 Nov 2026 10:02:25 +0100 Subject: [PATCH] fix: suppress the unused parameter sonar issue in TimerMock The `state` parameter of `GetIsBeingSetUp` is only used when `FEATURE_TIMEPROVIDER` is defined, so Sonar reports it as unused on the other target frameworks. Removing it would make Sonar ask to make the method static instead, so the issue is suppressed. --- Source/Testably.Abstractions.Testing/TimeSystem/TimerMock.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Testably.Abstractions.Testing/TimeSystem/TimerMock.cs b/Source/Testably.Abstractions.Testing/TimeSystem/TimerMock.cs index e7122f8f7..70cca4bb9 100644 --- a/Source/Testably.Abstractions.Testing/TimeSystem/TimerMock.cs +++ b/Source/Testably.Abstractions.Testing/TimeSystem/TimerMock.cs @@ -276,7 +276,9 @@ private bool IsTimeout() /// that a timeout which fires before would not cancel it. Its registration is read by reflection, as the type /// cannot be referenced. /// + #pragma warning disable S1172 // The parameter is only used when `FEATURE_TIMEPROVIDER` is defined. private static Func? GetIsBeingSetUp(object? state) + #pragma warning restore S1172 { #if FEATURE_TIMEPROVIDER if (DelayRegistrationField is { } field && state is Task delay &&