Skip to content

test: assert ParamName in null-argument contract tests (#50)#164

Merged
Chris-Wolfgang merged 1 commit into
mainfrom
feature/contract-test-gaps-46-49-50
Jun 23, 2026
Merged

test: assert ParamName in null-argument contract tests (#50)#164
Chris-Wolfgang merged 1 commit into
mainfrom
feature/contract-test-gaps-46-49-50

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Summary

Strengthens the ArgumentNullException contract tests in the Wolfgang.Etl.TestKit.Xunit base classes so they assert the exact ParamName ("items" / "progress"), not just the exception type. Implements issue #50.

22 assertion sites updated across 9 files (extractor / loader / transformer × base + WithProgress + WithProgressAndCancellation):

  • Sync (extractor/transformer): now capture var ex = Assert.Throws<…>(…) and assert ex.ParamName.
  • Async (loader): Assert.NotNull(ex) replaced with Assert.Equal("…", ex.ParamName).

Why it's safe (zero blast radius)

The null checks live in the Abstractions base classes, which throw new ArgumentNullException(nameof(items)) / nameof(progress). Every downstream component built on those bases inherits this behavior, so the tightened assertion is satisfied by all shipping extractors/loaders/transformers without any downstream change.

Verification

  • dotnet build -c Release — 0 warnings, 0 errors
  • dotnet test -c Release (TestKit.Xunit consumer test project) — 195 passed, 0 failed

Scope note

This PR addresses #50 only. The companion contract-test issues #46 (CurrentItemCount increment ordering) and #49 (no upstream over-read) are not included — both need a maintainer decision first:

Closes #50

🤖 Generated with Claude Code

Every ArgumentNullException contract test in the TestKit.Xunit base
classes now asserts the exact ParamName ("items" / "progress"), not
just the exception type. The Abstractions base classes throw with
nameof(items)/nameof(progress), so this is satisfied by every shipping
component built on them.

Closes #50

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Chris-Wolfgang Chris-Wolfgang merged commit a5992a2 into main Jun 23, 2026
8 checks passed
@Chris-Wolfgang Chris-Wolfgang deleted the feature/contract-test-gaps-46-49-50 branch June 23, 2026 01:33
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.

Contract test: null argument validation is identical across all components

1 participant