Repository navigation
test: record the null subject behaviour of every expectation - #1057
Merged
Merged
Conversation
`GuaranteesNotNullTests` only invoked the expectations marked with `[GuaranteesNotNull]`, so the behaviour of every other expectation for a `null` subject was unrecorded - and it cannot be read off the test suite either, because the null cases hide under four naming conventions and sometimes inside an `[InlineData(null)]` row. Sweep all 467 expectation names per subject type instead and assert the rule that a `null` subject fails, with `ExpectationsThatDoNotFail` listing today's 140 deviations (159 on `net48`, which has no generic math). This changes no behaviour; it is the safety net for the `null` philosophy of the next major version, where each change deletes entries from that list. To keep the record truthful, the harness now - skips subjects that cannot be `null`, reusing `CanHaveNullSubject`, - compiles no-op delegates instead of passing `null` for them, - puts one element into collection arguments, - tries nullable arguments as both `default` and `null`, - walks every completion path on a fresh subject, since reusing one expectation makes the second continuation throw and hides the family, - and separates "the test cannot build this call" from an expectation that throws, via `NotInvocableException`.
|
github-actions Bot
added a commit
that referenced
this pull request
Sep 12, 2026
…ur of every expectation (#1057) by Valentin Breuß
github-actions Bot
added a commit
that referenced
this pull request
Sep 12, 2026
…ur of every expectation (#1057) by Valentin Breuß
Contributor
👽 Mutation ResultsaweXpectDetails
The final mutation score is NaN%Coverage Thresholds: high:80 low:60 break:0aweXpect.CoreDetails
The final mutation score is NaN%Coverage Thresholds: high:80 low:60 break:0 |
Contributor
🚀 Benchmark ResultsDetails
|
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.



GuaranteesNotNullTestsonly invoked the expectations marked with[GuaranteesNotNull], so the behaviour of every other expectation for anullsubject was unrecorded - and it cannot be read off the test suite either, because the null cases hide under four naming conventions and sometimes inside an[InlineData(null)]row.Sweep all 467 expectation names per subject type instead and assert the rule that a
nullsubject fails, withExpectationsThatDoNotFaillisting today's 140 deviations (159 onnet48, which has no generic math).This changes no behaviour; it is the safety net for the
nullphilosophy of the next major version, where each change deletes entries from that list.To keep the record truthful, the harness now
null, reusingCanHaveNullSubject,nullfor them,defaultandnull,NotInvocableException.