chore(sonar): wrap independent assertions in Assert.Multiple (NUnit2045)
Driven by `dotnet format analyzers --diagnostics NUnit2045`. The fixer
groups consecutive independent `Assert.That(...)` calls into
`Assert.Multiple(() => { ... })`, so a failing assertion no longer
short-circuits the block — every failure inside the group is reported,
which gives much better diagnostics on multi-property tests.
Audit confirmed no Assert.Throws / Assert.Fail / Assert.Catch / Assert.Pass
/ Assert.DoesNotThrow got pulled inside a Multiple block (those need to
short-circuit). All 1180 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
505ada5017
commit
67512d23e1
@@ -20,9 +20,12 @@ public class CTEColumnListTests
|
||||
|
||||
// Act & Assert
|
||||
Assert.That(withClause.ColumnList, Has.Count.EqualTo(3));
|
||||
Assert.That(withClause.ColumnList[0], Is.EqualTo("user_id"));
|
||||
Assert.That(withClause.ColumnList[1], Is.EqualTo("user_name"));
|
||||
Assert.That(withClause.ColumnList[2], Is.EqualTo("user_email"));
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(withClause.ColumnList[0], Is.EqualTo("user_id"));
|
||||
Assert.That(withClause.ColumnList[1], Is.EqualTo("user_name"));
|
||||
Assert.That(withClause.ColumnList[2], Is.EqualTo("user_email"));
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -269,8 +272,11 @@ public class CTEColumnListTests
|
||||
// Assert
|
||||
Assert.That(sql, Contains.Substring("customer_transactions (trans_date, prod_id, cust_id, trans_amount, transaction_rank)"));
|
||||
var paramKeys = params_all.Keys.ToList();
|
||||
Assert.That(paramKeys.Any(k => k.Contains("StartDate")));
|
||||
Assert.That(paramKeys.Any(k => k.Contains("MinAmount")));
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(paramKeys.Any(k => k.Contains("StartDate")));
|
||||
Assert.That(paramKeys.Any(k => k.Contains("MinAmount")));
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user