Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the WithParamName and HasParamName APIs to accept a nullable expected parameter name, treating null as “do not verify”—and adds tests and API signature updates to cover that behavior.
- Allow
string? expectedand skip verification whenexpectedisnull. - Add unit tests in both exception-based and delegate-based lives to assert that
nullexpectations pass. - Update expected API snapshots to reflect the nullable
string? expectedsignatures.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Tests/aweXpect.Tests/Exceptions/ThatException.HasParamName.Tests.cs | Add tests for HasParamName(null) scenarios |
| Tests/aweXpect.Tests/Delegates/ThatDelegate.Throws.WithParamNameTests.cs | Add tests for Throws…().WithParamName(null) scenarios |
| Tests/aweXpect.Api.Tests/Expected/aweXpect_netstandard2.0.txt | Change WithParamName(string) → WithParamName(string?) |
| Tests/aweXpect.Api.Tests/Expected/aweXpect_net8.0.txt | Change WithParamName(string) → WithParamName(string?) |
| Source/aweXpect/That/Exceptions/ThatException.HasParamName.cs | Update signature to string? expected and constraint logic |
| Source/aweXpect/That/Delegates/ThatDelegateThrows.WithParamName.cs | Update signature, add a null‐skip branch in WithParamName |
Comments suppressed due to low confidence (2)
Tests/aweXpect.Tests/Exceptions/ThatException.HasParamName.Tests.cs:11
- [nitpick] The test name says ‘ParamNameIsEmpty’ but the default
ArgumentExceptionconstructor setsParamNametonull, not an empty string. Consider renaming toParamNameIsNullfor clarity.
public async Task WhenExpectedIsNull_AndParamNameIsEmpty_ShouldSucceed(string message)
Tests/aweXpect.Tests/Delegates/ThatDelegate.Throws.WithParamNameTests.cs:11
- [nitpick] Similar to the exception-based test, this delegate test name implies an empty string but
ParamNameisnullby default. Renaming toParamNameIsNullwould be more accurate.
public async Task WhenExpectedIsNull_AndParamNameIsEmpty_ShouldSucceed(string message)
|
🚀 Benchmark ResultsDetails
|
👽 Mutation ResultsaweXpectDetails
The final mutation score is 50.00%Coverage Thresholds: high:80 low:60 break:0aweXpect.CoreDetails
The final mutation score is NaN%Coverage Thresholds: high:80 low:60 break:0 |
…#678) by Valentin Breuß
…#678) by Valentin Breuß
|
This is addressed in release v2.19.1. |



This PR enhances the WithParamName and HasParamName APIs to accept a nullable expected parameter name, treating null as “do not verify”.