From e18a59d5d0c56cfdfa171e1bdbd01727466a1c55 Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Mon, 29 Jul 2024 13:01:19 +1000 Subject: [PATCH] Disable S3236 in fake time provider. (#5315) --- .../FakeTimeProvider.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Libraries/Microsoft.Extensions.TimeProvider.Testing/FakeTimeProvider.cs b/src/Libraries/Microsoft.Extensions.TimeProvider.Testing/FakeTimeProvider.cs index 407eecdd1af..9a7ab1d252f 100644 --- a/src/Libraries/Microsoft.Extensions.TimeProvider.Testing/FakeTimeProvider.cs +++ b/src/Libraries/Microsoft.Extensions.TimeProvider.Testing/FakeTimeProvider.cs @@ -172,7 +172,9 @@ public override long GetTimestamp() // The same issue could occur converting back, in GetElapsedTime(). Unfortunately // that isn't virtual so we can't do the same trick. However, if tests advance // the clock in multiples of 1ms or so this loss of precision will not be visible. +#pragma warning disable S3236 // Caller information arguments should not be provided explicitly Debug.Assert(TimestampFrequency == TimeSpan.TicksPerSecond, "Assuming frequency equals ticks per second"); +#pragma warning restore S3236 // Caller information arguments should not be provided explicitly return _now.Ticks; }