From be0ae44cca3360b8bce9b5aa0a0da071458072da Mon Sep 17 00:00:00 2001 From: Cory Knox Date: Fri, 8 Nov 2024 07:42:58 -0800 Subject: [PATCH] (#3526) Validate version numbers in Info logs This updates the tests to validate that the version number is not output in the Info log messages only. There are some debug log messages that may contain a similar version number as they report the user agent being used, this prevents them from being erroneously picked up. --- src/chocolatey.tests.integration/scenarios/ListScenarios.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs index d00930ddd8..01818fdcb5 100644 --- a/src/chocolatey.tests.integration/scenarios/ListScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/ListScenarios.cs @@ -116,7 +116,7 @@ public void Should_contain_package_name() [Fact] public void Should_not_contain_any_version_number() { - MockLogger.ContainsMessage(".0").Should().BeFalse(); + MockLogger.ContainsMessage(".0", LogLevel.Info).Should().BeFalse(); } } @@ -196,7 +196,7 @@ public void Should_contain_packages_id() [Fact] public void Should_not_contain_any_version_number() { - MockLogger.ContainsMessage(".0").Should().BeFalse(); + MockLogger.ContainsMessage(".0", LogLevel.Info).Should().BeFalse(); } [Fact]