Conversation
Add negated overloads `IsNotContainedIn` and `DoesNotContain` for collections.
There was a problem hiding this comment.
Pull Request Overview
Adds negated collection expectations and updates error-message formatting to clearly separate the actual “Collection” and the “Expected” values in negated assertions.
- Introduce
DoesNotContainandIsNotContainedInoverloads for bothIEnumerable<T>andIAsyncEnumerable<T>. - Enhance constraint builders to add explicit expected‐value contexts and streamline negated message output.
- Update tests and API snapshots to assert the new multi‐section formatting and reflect the new overloads.
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/aweXpect.Tests/Collections/ThatEnumerable.IsNotEqualTo.Tests.cs | Updated expected error message formatting to include separate “Collection” and “Expected” sections |
| Tests/aweXpect.Tests/Collections/ThatEnumerable.IsEqualTo.WithinTests.cs | Added “Expected” context lines to Within‐tolerance tests |
| Tests/aweXpect.Tests/Collections/ThatEnumerable.DoesNotContain.Tests.cs | Changed class to partial and removed null‐predicate tests |
| Tests/aweXpect.Tests/Collections/ThatAsyncEnumerable.IsNotEqualTo.WithinTests.cs | Added “Expected” context lines to async Within‐tolerance tests |
| Tests/aweXpect.Tests/Collections/ThatAsyncEnumerable.IsNotEqualTo.Tests.cs | Added “Expected” context lines to async not‐equal tests |
| Tests/aweXpect.Tests/Collections/ThatAsyncEnumerable.IsEqualTo.WithinTests.cs | Added “Expected” context lines to async equality Within‐tests |
| Tests/aweXpect.Tests/Collections/ThatAsyncEnumerable.DoesNotContain.Tests.cs | Changed class to partial and removed null‐predicate tests |
| Tests/aweXpect.Api.Tests/Expected/aweXpect_netstandard2.0.txt | Added API signatures for DoesNotContain and IsNotContainedIn overloads |
| Tests/aweXpect.Api.Tests/Expected/aweXpect_net8.0.txt | Added API signatures for async DoesNotContain and IsNotContainedIn overloads |
| Source/aweXpect/That/Collections/ThatEnumerable.cs | Added expected‐value context support and simplified negated result formatting |
| Source/aweXpect/That/Collections/ThatEnumerable.IsContainedIn.cs | Introduced IsNotContainedIn overloads for IEnumerable<T> |
| Source/aweXpect/That/Collections/ThatEnumerable.Contains.cs | Introduced DoesNotContain overloads for IEnumerable<T> |
| Source/aweXpect/That/Collections/ThatAsyncEnumerable.cs | Added expected‐value context support to async enumerable matcher and simplified deviation error text |
| Source/aweXpect/That/Collections/ThatAsyncEnumerable.IsContainedIn.cs | Introduced IsNotContainedIn overloads for IAsyncEnumerable<T> |
| Source/aweXpect/That/Collections/ThatAsyncEnumerable.Contains.cs | Introduced DoesNotContain overloads for IAsyncEnumerable<T> |
| Docs/pages/docs/expectations/07-collections.md | Documented DoesNotContain and IsNotContainedIn expectations |
Comments suppressed due to low confidence (2)
Tests/aweXpect.Tests/Collections/ThatEnumerable.DoesNotContain.Tests.cs:926
- The null‐predicate validation test for
DoesNotContainwas removed, leaving no coverage to ensure passing a null predicate throws the expected exception. Consider reintroducing a test for null predicate behavior.
[Fact]
Tests/aweXpect.Tests/Collections/ThatAsyncEnumerable.DoesNotContain.Tests.cs:888
- The null‐predicate validation test for async
DoesNotContainwas removed, so there's no test ensuring a null predicate triggers the correct exception. Consider adding it back.
[Fact]
🚀 Benchmark ResultsDetails
|
👽 Mutation ResultsaweXpectDetails
The final mutation score is 86.68%Coverage Thresholds: high:80 low:60 break:0aweXpect.CoreDetails
The final mutation score is NaN%Coverage Thresholds: high:80 low:60 break:0 |
…edIn.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
…ins` (#627) by Valentin Breuß
…ins` (#627) by Valentin Breuß
|
This is addressed in release v2.15.0. |



Add negated overloads
IsNotContainedInandDoesNotContainfor collections.