From d67ddab290010ae5e3077d1869291c513f6523ae Mon Sep 17 00:00:00 2001 From: benbierens Date: Fri, 15 Dec 2023 09:32:03 +0100 Subject: [PATCH] Checking for all unwanted log entries --- Tests/DistTestCore/DownloadedLogExtensions.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Tests/DistTestCore/DownloadedLogExtensions.cs b/Tests/DistTestCore/DownloadedLogExtensions.cs index 30a45b19..b000439f 100644 --- a/Tests/DistTestCore/DownloadedLogExtensions.cs +++ b/Tests/DistTestCore/DownloadedLogExtensions.cs @@ -10,9 +10,17 @@ namespace DistTestCore Assert.That(log.DoesLogContain(expectedString), $"Did not find '{expectedString}' in log."); } - public static void AssertLogDoesNotContain(this IDownloadedLog log, string unexpectedString) + public static void AssertLogDoesNotContain(this IDownloadedLog log, params string[] unexpectedStrings) { - Assert.That(!log.DoesLogContain(unexpectedString), $"Did find '{unexpectedString}' in log."); + var errors = new List(); + foreach (var str in unexpectedStrings) + { + if (log.DoesLogContain(str)) + { + errors.Add($"Did find '{str}' in log."); + } + } + CollectionAssert.IsEmpty(errors); } } }