From 92dd809dd1d9728f13e09477b6523033ee98b877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20M=C3=A1rkus?= Date: Tue, 27 Feb 2024 17:29:33 +0100 Subject: [PATCH] Fixing tests. --- .../Tests/BasicTests/SecurityScanningTests.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/OrchardCore.Commerce.Tests.UI/Tests/BasicTests/SecurityScanningTests.cs b/test/OrchardCore.Commerce.Tests.UI/Tests/BasicTests/SecurityScanningTests.cs index 8590a5639..75ed1ccaa 100644 --- a/test/OrchardCore.Commerce.Tests.UI/Tests/BasicTests/SecurityScanningTests.cs +++ b/test/OrchardCore.Commerce.Tests.UI/Tests/BasicTests/SecurityScanningTests.cs @@ -38,12 +38,15 @@ public Task FullSecurityScanShouldPass() => }), changeConfiguration: configuration => configuration.AssertAppLogsAsync = async webApplicationInstance => { - var logsWithoutFalseIOExpection = (await webApplicationInstance.GetLogOutputAsync()) + var logsWithoutUnwantedExpectionMessages = (await webApplicationInstance.GetLogOutputAsync()) .SplitByNewLines() .Where(message => - !message.ContainsOrdinalIgnoreCase("System.IO.DirectoryNotFoundException: Could not find a part of the path")); + !message.ContainsOrdinalIgnoreCase("System.IO.DirectoryNotFoundException: Could not find a part of the path") && + !message.ContainsOrdinalIgnoreCase( + "System.IO.IOException: The filename, directory name, or volume label syntax is incorrect") && + !message.ContainsOrdinalIgnoreCase("System.InvalidOperationException: This action intentionally causes an exception!")); - logsWithoutFalseIOExpection.ShouldNotContain(item => item.Contains("|ERROR|")); + logsWithoutUnwantedExpectionMessages.ShouldNotContain(item => item.Contains("|ERROR|")); }); private static void FalsePositive(