Repository navigation
docs: state the null rule that extension authors must follow - #1100
Merged
Merged
Conversation
The author rule still said the exception is "those that compare it against a value the caller supplied", which is the formulation the sweep disproved: `HasValue(2)` takes a supplied value and fails for `null`, and an ordering or a range gives `null` no meaning on either side even though both take one. Only equality and identity do, so that is what the rule now names, together with the negated case that `DoesNotComplyWith` exposes. The worked example contradicted the paragraph three lines above it by using `WithValue<string>` for an expectation that inspects a string - the exact mistake that let a null subject satisfy the negated form of `HasItem` and `Implies`. It now uses `WithNotNullValue<string>` and the inherited `It`, with a note about CS9107, because an author who follows the rule and switches base hits that error with no warning. The three base classes differ only in how they treat a `null` actual, and that was the one thing their own documentation did not say. `WithEqualToValue` in particular encoded the decision as `IsNegated == isExpectedNull` with no explanation; the four cases are now spelled out.
|
Contributor
Test Results 23 files - 27 23 suites - 27 9m 24s ⏱️ +14s Results for commit c8f3dc5. ± Comparison against base commit 48275fc. This pull request removes 3228 and adds 3192 tests. Note that renamed tests count towards both. |
Contributor
🚀 Benchmark ResultsDetails
|
Contributor
👽 Mutation ResultsaweXpectDetails
The final mutation score is NaN%Coverage Thresholds: high:80 low:60 break:0aweXpect.CoreDetails
The final mutation score is 100.00%Coverage Thresholds: high:80 low:60 break:0 |
github-actions Bot
added a commit
that referenced
this pull request
Sep 14, 2026
…n authors must follow (#1100) by Valentin Breuß
github-actions Bot
added a commit
that referenced
this pull request
Sep 14, 2026
…n authors must follow (#1100) by Valentin Breuß
This was referenced Oct 12, 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.



The author rule still said the exception is "those that compare it against a value the caller supplied", which is the formulation the sweep disproved:
HasValue(2)takes a supplied value and fails fornull, and an ordering or a range givesnullno meaning on either side even though both take one. Only equality and identity do, so that is what the rule now names, together with the negated case thatDoesNotComplyWithexposes.The worked example contradicted the paragraph three lines above it by using
WithValue<string>for an expectation that inspects a string - the exact mistake that let a null subject satisfy the negated form ofHasItemandImplies. It now usesWithNotNullValue<string>and the inheritedIt, with a note about CS9107, because an author who follows the rule and switches base hits that error with no warning.The three base classes differ only in how they treat a
nullactual, and that was the one thing their own documentation did not say.WithEqualToValuein particular encoded the decision asIsNegated == isExpectedNullwith no explanation; the four cases are now spelled out.