dennisdoomen / dennisdoomen/fluentassertions.mockly
[API Proposal]: Catch up with core Mockly features (RawBody, ProblemDetails, ContentType)
- Dominant language
- C#
- Stars
- 0
- Forks
- 0
- Avg merge
- 11d 7h
- Merged PRs (30d)
- 4
Description
## Problem
Both packages pin `Mockly [1.7.0,2.0.0)`, but **Mockly 1.10.0** is on NuGet. Several core features shipped since then have no assertion counterpart at all, so the assertion library is drifting behind the thing it asserts on.
Missing coverage:
| Core feature | Core issue | Missing assertion |
| --- | --- | --- |
| `CapturedRequest.RawBody` (binary bodies) | dennisdoomen/mockly#156 | `WithRawBody(byte[])` |
| `RespondsWithProblemDetails` (RFC 7807) | dennisdoomen/mockly#122 | `WithProblemDetails(...)` |
| `WithContentType` matcher | dennisdoomen/mockly#114 | `WithContentType(pattern)` |
| `RespondsWithFile` / `Stream` / `Bytes` | dennisdoomen/mockly#123 | binary/response-content assertions |
## Proposed API
```csharp
// Binary request bodies — currently only the string Body is assertable
requests.Should().ContainRequest().WithRawBody(expectedBytes);
// Content type of the request
requests.Should().ContainRequest().WithContentType("application/json");
// Problem Details responses
requests.Should().ContainRequestFor("/api/users/999")
.WithProblemDetails(HttpStatusCode.NotFound, title: "User not found");
```
## Scope
- Bump the `Mockly` dependency floor so the newer members are reachable
- Add the assertions to `Shared/HttpMockAssertionExtensions.cs` (covers both v7 and v8)
- Specs in both `.Specs` projects, then `AcceptApiChanges.ps1` and commit the approved-API files
## Notes
Worth considering a lightweight check in CI, or just a recurring habit, so that a new core feature does not ship without asking whether it needs an assertion counterpart.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in Shared/HttpMockAssertionExtensions.cs and inspect the existing assertion patterns and the Mockly dependency references. Add coverage for RawBody, ProblemDetails, ContentType, and the listed response content features, then add specs in both .Specs projects. Run AcceptApiChanges.ps1 and commit the approved-API files when the new assertions and dependency floor are covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100