Skip to content

Tests: clear three xUnit analyzer warnings - #749

Merged
erikdarlingdata merged 1 commit into
devfrom
fix/test-analyzer-warnings
Dec 1, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
fix/test-analyzer-warnings

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Clears the three xUnit analyzer warnings that #742 added to the Core tests. Test-only change.

Warnings fixed:

  • xUnit1051, CappedCostTests.cs line 166: GetExpensiveOperators(session, 10) now passes TestContext.Current.CancellationToken.
  • xUnit2029, NestedLoopsInnerCheckTests.cs line 102: Assert.Empty(x.Warnings.Where(pred)) is now Assert.DoesNotContain(x.Warnings, pred).
  • xUnit2031, NestedLoopsInnerCheckTests.cs line 103: Assert.Single(x.Warnings.Where(pred)) is now Assert.Single(x.Warnings, pred).

The same patterns do not appear elsewhere in those two files.

Verification:

  • dotnet build PlanViewer.sln -c Release: 0 Warning(s), 0 Error(s); no xUnit lines in the output.
  • PlanViewer.Core.Tests.exe -class "*CappedCostTests*": Total: 14, Failed: 0.
  • PlanViewer.Core.Tests.exe -class "*NestedLoopsInnerCheckTests*": Total: 12, Failed: 0.
  • Full suite not run here; CI runs it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M98owdDaj4ReE2NfjxDDuU

@erikdarlingdata
erikdarlingdata marked this pull request as ready for review December 1, 2026 05:49
@claude

claude Bot commented Dec 1, 2026

Copy link
Copy Markdown

Reviewed: test-only change. It passes TestContext.Current.CancellationToken to GetExpensiveOperators (an internal overload exists, and the tests can reach it) and swaps Assert.Empty(...Where) and Assert.Single(...Where) for the predicate overloads. Behavior is unchanged. There are no version, NoWarn, or SQL concerns. No findings.

@erikdarlingdata
erikdarlingdata merged commit 6783588 into dev Dec 1, 2026
4 checks passed
@erikdarlingdata
erikdarlingdata deleted the fix/test-analyzer-warnings branch December 1, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant