test: assert ParamName in null-argument contract tests (#50)#164
Merged
Conversation
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>
This was referenced Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Strengthens the
ArgumentNullExceptioncontract tests in theWolfgang.Etl.TestKit.Xunitbase classes so they assert the exactParamName("items"/"progress"), not just the exception type. Implements issue #50.22 assertion sites updated across 9 files (extractor / loader / transformer × base + WithProgress + WithProgressAndCancellation):
var ex = Assert.Throws<…>(…)and assertex.ParamName.Assert.NotNull(ex)replaced withAssert.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 errorsdotnet test -c Release(TestKit.Xunit consumer test project) — 195 passed, 0 failedScope 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:
count == i+1after each MoveNext) and the actualTestExtractorimplementation both use increment-before-yield. The spec is self-contradictory re: the intended ordering contract.Closes #50
🤖 Generated with Claude Code