dennisdoomen / dennisdoomen/fluentassertions.mockly
WithQueryParam(name) and WithResponseHeader(name) are missing because/becauseArgs
- Dominant language
- C#
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Problem
Every assertion in the library takes the standard `because` / `becauseArgs` pair — except two:
```csharp
public AndWhichConstraint WithQueryParam(string name) { }
public AndWhichConstraint WithResponseHeader(string name) { }
```
Compare with their own two-argument siblings, which do have them:
```csharp
public AndWhichConstraint<...> WithQueryParam(string name, string valuePattern, string because = "", params object[] becauseArgs) { }
public AndWhichConstraint<...> WithResponseHeader(string name, string value, string because = "", params object[] becauseArgs) { }
```
And with the equivalent presence-only overload on headers, which does have them:
```csharp
public AndWhichConstraint<...> WithHeader(string name, string because = "", params object[] becauseArgs) { }
```
## Why it matters
It silently blocks the standard FluentAssertions idiom for those two assertions, and it is inconsistent enough to look like an oversight rather than a decision.
## Proposal
Add `string because = "", params object[] becauseArgs` to both, and pass them to the existing `BecauseOf(...)` call. Purely additive, though it still needs an `AcceptApiChanges.ps1` run.
Note the `WithHeader(string name, ...)` precedent: adding a trailing `because` to a single-string-argument overload can create ambiguity with a two-string-argument overload. `WithHeader` already lives with this, so the same resolution applies.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the WithQueryParam(string name) and WithResponseHeader(string name) declarations and inspect their existing BecauseOf(...) calls and two-argument siblings. Add the trailing because and becauseArgs parameters, forward them consistently, then run AcceptApiChanges.ps1 to verify the API changes are accepted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100