chore(sonar): hoist constant array literals to static readonly fields (CA1861)
Applied via `dotnet format analyzers --diagnostics CA1861 --severity info`,
plus manual cleanup:
- Renamed two cryptic fixer-generated field names:
- QueryBreakdownCollection.stringArray -> SnowflakeFunctionNames (and
inlined the now-redundant local alias)
- ExpressionObjectTests.arg2 -> NotInValues
- Deduped three identical `separator = ['\r','\n']` fields the fixer
emitted in the same test class (kept the first declaration; the other
two test methods now reuse it).
8 files touched.
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
84b06557e5
commit
f5d539b906
@@ -7,6 +7,7 @@ namespace Strata.SqlTools.LinqToSql.Tests;
|
||||
public class LinqQueryBreakdownTests
|
||||
{
|
||||
private TestDataContext _context = null!;
|
||||
private static readonly string[] separator = new[] { "AND" };
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
@@ -303,7 +304,7 @@ public class LinqQueryBreakdownTests
|
||||
Assert.That(filterSql, Does.Contain("IsActive = 1"));
|
||||
|
||||
// Should have multiple AND conditions
|
||||
var andCount = filterSql.Split(new[] { "AND" }, StringSplitOptions.None).Length - 1;
|
||||
var andCount = filterSql.Split(separator, StringSplitOptions.None).Length - 1;
|
||||
Assert.That(andCount, Is.GreaterThanOrEqualTo(2));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user