Repository navigation
refactor: name every expectation receiver subject - #1122
Merged
Merged
Conversation
vbreuss
enabled auto-merge (squash)
September 15, 2026 09:16
vbreuss
disabled auto-merge
September 15, 2026 09:17
vbreuss
force-pushed
the
refactor/rename-receiver-parameter
branch
from
September 15, 2026 09:20
0f8f5f7 to
4ed3d5d
Compare
The receiver parameter was `source` in 792 signatures and `subject` in 78, a split that was historical rather than semantic: the `subject` group is just the collection quantifier family plus `HasCount`. `source` is LINQ vocabulary for a sequence, while the library calls the value under test the subject everywhere else - `IThatSubject<T>`, `ThatSubject<T>`, `IDescribableSubject`. Renaming a `this` parameter cannot affect extension-method invocation syntax, so this only reaches callers that use static-form invocation with named arguments. The API approval diff is the proof that nothing else moved: every changed line is a parameter name, and no `source` is left anywhere in the public surface. Two places beyond the extension receivers followed, because they carry the same subject: the expectation source generator, whose template would otherwise keep emitting `source` into the generated `ThatChar` and `ThatGuid` expectations, and the `PropertyResult` constructors, which take the subject rather than a receiver but are public API all the same. `LinqAsyncHelpers` keeps `source`, where it genuinely is a sequence. Two smaller receivers follow the same reasoning: the equivalency extensions no longer need the escaped `@this`, and the `ValueFormatter` overloads that ignore their receiver spell it `formatter` like the other 82 instead of `_`. Closes #1119
vbreuss
force-pushed
the
refactor/rename-receiver-parameter
branch
from
September 15, 2026 09:26
4ed3d5d to
f51ae5c
Compare
|
Contributor
Test Results 26 files - 27 26 suites - 27 10m 6s ⏱️ - 1m 19s Results for commit f51ae5c. ± Comparison against base commit d095969. This pull request removes 3232 and adds 3192 tests. Note that renamed tests count towards both. |
github-actions Bot
added a commit
that referenced
this pull request
Sep 15, 2026
…er `subject` (#1122) by Valentin Breuß
github-actions Bot
added a commit
that referenced
this pull request
Sep 15, 2026
…er `subject` (#1122) by Valentin Breuß
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.



The receiver parameter was
sourcein 792 signatures andsubjectin 78, a split that was historical rather than semantic: thesubjectgroup is just the collection quantifier family plusHasCount.sourceis LINQ vocabulary for a sequence, while the library calls the value under test the subject everywhere else -IThatSubject<T>,ThatSubject<T>,IDescribableSubject.Renaming a
thisparameter cannot affect extension-method invocation syntax, so this only reaches callers that use static-form invocation with named arguments. The API approval diff is the proof that nothing else moved: all 2536 changed lines are parameter names.LinqAsyncHelperskeepssource, where it genuinely is a sequence. Two smaller receivers follow the same reasoning: the equivalency extensions no longer need the escaped@this, and theValueFormatteroverloads that ignore their receiver spell itformatterlike the other 82 instead of_.subject#1119