From 2fae7738e31bf7049d720d75560d29b754052ccd Mon Sep 17 00:00:00 2001 From: Thom Lamb Date: Wed, 20 May 2026 13:02:28 -0500 Subject: [PATCH] test(pgsql): wrap CommandVisitor asserts in Assert.Multiple Resolves SonarQube NUnit2045. The three independent parameter-index assertions now report together instead of short-circuiting on the first failure. The Is.Not.Null guard in the reflection helper stays outside the multiple block because it gates the subsequent Invoke. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../PostgreSql/CommandVisitorTests.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/Strata.SqlTools.PostgreSql.Tests/PostgreSql/CommandVisitorTests.cs b/tests/Strata.SqlTools.PostgreSql.Tests/PostgreSql/CommandVisitorTests.cs index 1b3896a..7745a44 100644 --- a/tests/Strata.SqlTools.PostgreSql.Tests/PostgreSql/CommandVisitorTests.cs +++ b/tests/Strata.SqlTools.PostgreSql.Tests/PostgreSql/CommandVisitorTests.cs @@ -15,9 +15,12 @@ public class CommandVisitorTests var param1b = InvokeFormatParameterName(visitor1, "p"); var param2a = InvokeFormatParameterName(visitor2, "p"); - Assert.That(param1a, Is.EqualTo("$1"), "first visitor's first parameter should be $1"); - Assert.That(param1b, Is.EqualTo("$2"), "first visitor's second parameter should be $2"); - Assert.That(param2a, Is.EqualTo("$1"), "second visitor must start at $1, not inherit visitor1's counter"); + Assert.Multiple(() => + { + Assert.That(param1a, Is.EqualTo("$1"), "first visitor's first parameter should be $1"); + Assert.That(param1b, Is.EqualTo("$2"), "first visitor's second parameter should be $2"); + Assert.That(param2a, Is.EqualTo("$1"), "second visitor must start at $1, not inherit visitor1's counter"); + }); } private static string InvokeFormatParameterName(CommandVisitor visitor, string name)