From 5402c7ba6f488848b5530b56c2ad5c5b15af36db Mon Sep 17 00:00:00 2001 From: Ivan Vydrin Date: Thu, 30 Jul 2026 01:21:41 +0300 Subject: [PATCH] Build the solution with no warnings at all A cold build reported eight. I had been reading warning counts off incremental builds, where analyzer and obsolete diagnostics do not reappear, so I called the solution clean when it was not. Two were mine from the Redis provider: Testcontainers has deprecated the parameterless RedisBuilder in favour of the one that takes the image, which is where the image belonged anyway rather than in a separate WithImage call. The other six are three diagnostics, each counted once per target framework, and all three are also mine from earlier in this run: two Assert.Equal calls checking a collection's size where Assert.Single says it, and a Task.Delay without the test's cancellation token. I had reverted exactly these once before, to keep an unrelated diff focused, which was right then and left them as the last thing standing between the build and a real zero. Nothing here changes behaviour. It means the next warning to appear will be visible instead of arriving in a crowd. --- tests/Healthie.Tests.Unit/DiagnosticsTests.cs | 2 +- tests/Healthie.Tests.Unit/HardeningTests.cs | 2 +- tests/Healthie.Tests.Unit/RedisStateProviderTests.cs | 2 +- tests/Healthie.Tests.Unit/UptimeTests.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Healthie.Tests.Unit/DiagnosticsTests.cs b/tests/Healthie.Tests.Unit/DiagnosticsTests.cs index 7bf46b1..f741959 100644 --- a/tests/Healthie.Tests.Unit/DiagnosticsTests.cs +++ b/tests/Healthie.Tests.Unit/DiagnosticsTests.cs @@ -178,7 +178,7 @@ public async Task ATransition_IsCountedOnceAndNotOnEveryTick() Assert.Equal(1, afterTheChange); Assert.Equal(3, For("healthie.check.results", name).Count); - Assert.Equal(1, For("healthie.check.transitions", name).Count); + Assert.Single(For("healthie.check.transitions", name)); } /// diff --git a/tests/Healthie.Tests.Unit/HardeningTests.cs b/tests/Healthie.Tests.Unit/HardeningTests.cs index 8521898..120f747 100644 --- a/tests/Healthie.Tests.Unit/HardeningTests.cs +++ b/tests/Healthie.Tests.Unit/HardeningTests.cs @@ -19,7 +19,7 @@ public void ADashboardTitle_CannotCloseTheTitleElement() var page = Healthie.Dashboard.StartupExtensions.BuildPage(""); // One closing title tag: the one the page itself writes. - Assert.Equal(1, Regex.Matches(page, "", RegexOptions.IgnoreCase).Count); + Assert.Single(Regex.Matches(page, "", RegexOptions.IgnoreCase)); Assert.DoesNotContain("