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:
Thom Lamb
2026-05-27 11:59:47 -05:00
co-authored by Claude Opus 4.7
parent 505ada5017
commit 67512d23e1
47 changed files with 2132 additions and 1113 deletions
@@ -58,8 +58,11 @@ public class QueryBreakdownRepositoryTests
// Assert
Assert.That(retrieved, Is.Not.Null);
Assert.That(retrieved?.SelectClause?.Clause, Is.EqualTo("ID, Name"));
Assert.That(retrieved?.FromClause?.Clause, Is.EqualTo("Users"));
Assert.Multiple(() =>
{
Assert.That(retrieved?.SelectClause?.Clause, Is.EqualTo("ID, Name"));
Assert.That(retrieved?.FromClause?.Clause, Is.EqualTo("Users"));
});
}
[Test]
@@ -117,9 +120,12 @@ public class QueryBreakdownRepositoryTests
bool deleted = await _repository.DeleteAsync(id);
var retrieved = await _repository.GetByIdAsync(id);
// Assert
Assert.That(deleted, Is.True);
Assert.That(retrieved, Is.Null);
Assert.Multiple(() =>
{
// Assert
Assert.That(deleted, Is.True);
Assert.That(retrieved, Is.Null);
});
}
[Test]