chore(sonar): second sweep — catch .Length, Is.Not.Empty, and newly-exposed Multiple groups (NUnit2046, NUnit2045)
SonarQube Analysis / sonarqube (pull_request) Successful in 2m59s

Re-runs `dotnet format analyzers --diagnostics NUnit2046 NUnit2045` after
the Tier 2 Assert.Multiple wrap, which exposed:

- `Has.Length.EqualTo(n)` rewrites for `string[]`/array `.Length` checks
  (the first pass only knew about `.Count`).
- `Is.Not.Empty` rewrites for `Count, Is.GreaterThan(0)`.
- A handful of new NUnit2045 groups that became wrappable once the
  initial Multiple blocks settled the surrounding indentation.

Tests still 1180/1180 passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Thom Lamb
2026-05-27 12:14:13 -05:00
co-authored by Claude Opus 4.7
parent 470cb009b9
commit 4fe9eb36e6
18 changed files with 50 additions and 39 deletions
@@ -360,7 +360,7 @@ public class QueryBreakdownCollectionTests
var report = _collection.GetParameterUsageReport().ToList();
// Assert
Assert.That(report.Count, Is.GreaterThan(0));
Assert.That(report, Is.Not.Empty);
var userIdReport = report.FirstOrDefault(r => r.ParameterName == "UserId");
Assert.That(userIdReport, Is.Not.Null);
Assert.That(userIdReport?.UsedInQueryCount, Is.EqualTo(2));
@@ -29,9 +29,12 @@ public class QueryBreakdownTests
Assert.That(query.FinishClauses, Is.Not.Null);
Assert.That(query.WithClauses, Is.Not.Null);
});
Assert.That(query.WithClauses, Is.Empty);
Assert.That(query.Parameters, Is.Not.Null);
Assert.That(query.ParameterList, Is.Not.Null);
Assert.Multiple(() =>
{
Assert.That(query.WithClauses, Is.Empty);
Assert.That(query.Parameters, Is.Not.Null);
Assert.That(query.ParameterList, Is.Not.Null);
});
}
[Test]
@@ -778,10 +781,13 @@ public class QueryBreakdownTests
Assert.That(withIndex, Is.GreaterThan(-1));
Assert.That(mainSelectIndex, Is.GreaterThan(-1));
});
Assert.That(withIndex, Is.LessThan(mainSelectIndex));
Assert.Multiple(() =>
{
Assert.That(withIndex, Is.LessThan(mainSelectIndex));
// Assert - Verify CTE definition
Assert.That(sql, Does.Contain("ProductTotals"));
// Assert - Verify CTE definition
Assert.That(sql, Does.Contain("ProductTotals"));
});
Assert.That(sql, Does.Contain("AS"));
Assert.That(sql, Does.Contain("ProductID"));
Assert.That(sql, Does.Contain("TotalQuantity"));