Repository navigation
feat: generate collection expectations with [GenerateCollectionExpectation] - #1834
Merged
Merged
Conversation
Contributor
Test Results 20 files - 71 20 suites - 71 1h 17m 20s ⏱️ - 45m 24s Results for commit ba36d8b. ± Comparison against base commit 2bdfbc6. This pull request removes 32109 and adds 388 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
vbreuss
force-pushed
the
feat/generate-collection-expectation
branch
from
October 16, 2026 07:02
81b1e07 to
a202f9c
Compare
…tation]` A predicate marked with `[GenerateExpectation]` only verifies a single subject, so verifying the items of a collection still needed `ComplyWith` or a hand-written `QuantifiedCollectionConstraint`. `[GenerateCollectionExpectation]` generates the expectation on the elements that a quantifier selects from the same kind of method, e.g. `That(tracks).All().AreRadioFriendly()`. - it takes the expectation text on a single item and its plural, as a nested expectation reads "has values of which at least 2 are radio friendly"; the quantifier carries the negation - it extends the elements of every collection that can hold the item: `IEnumerable<T>`, struct collections like `ImmutableArray<T>` and, where available, `IAsyncEnumerable<T>`, with the string elements for a `string` item - a `null` item does not match unless the item parameter is nullable, with `[DisallowNull]` and `NullableOverload` working like for a subject - the generated constraints derive from the new `GeneratedCollectionConstraint` and `GeneratedAsyncCollectionConstraint` in aweXpect.Core The build scope is set to `CoreOnly`, because the generator tests compile the generated code against the new base constraints of aweXpect.Core. Under that scope the generator tests now run with coverage reports next to the Core tests, as the coverage of the generator was missing otherwise.
vbreuss
force-pushed
the
feat/generate-collection-expectation
branch
from
October 16, 2026 07:02
a202f9c to
ba36d8b
Compare
|
Contributor
|
This is addressed in release v3.3.0. |
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.



A predicate marked with
[GenerateExpectation]only verifies a single subject, so verifying the items of a collection still neededComplyWithor a hand-writtenQuantifiedCollectionConstraint.[GenerateCollectionExpectation]generates the expectation on the elements that a quantifier selects from the same kind of method, e.g.That(tracks).All().AreRadioFriendly().IEnumerable<T>, struct collections likeImmutableArray<T>and, where available,IAsyncEnumerable<T>, with the string elements for astringitemnullitem does not match unless the item parameter is nullable, with[DisallowNull]andNullableOverloadworking like for a subjectGeneratedCollectionConstraintandGeneratedAsyncCollectionConstraintin aweXpect.CoreThe build scope is set to
CoreOnly, because the generator tests compile the generated code against the new base constraints of aweXpect.Core. Under that scope the generator tests now run with coverage reports next to the Core tests, as the coverage of the generator was missing otherwise.