dennisdoomen / dennisdoomen/fluentassertions.mockly

Add BeASimulatedFailure assertion (companion to mockly#116)

Open
#31 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Companion to dennisdoomen/mockly#116 (simulated network failures: ThrowsException / TimesOut), PR dennisdoomen/mockly#136.

## Summary
Add an assertion to verify that a captured entry corresponds to an *intended simulated failure* (a thrown transport error / timeout) rather than an unexpected 500 or a normal response.

## Proposed API (additive)
On `CapturedRequestAssertions` in `Shared/HttpMockAssertionExtensions.cs` (next to the existing `BeExpected()` / `BeUnexpected()`):
```csharp
AndConstraint BeASimulatedFailure(string because = "", params object[] becauseArgs);
```

## Implementation notes
- Follow the existing `BeExpected`/`BeUnexpected` patterns.
- Update BOTH `v7` and `v8` packages (shared via `Shared/`); add specs to both `.Specs` projects.
- Run `AcceptApiChanges.ps1` and commit updated approved-API files.

## Dependency / blocker (IMPORTANT)
This needs the **core** Mockly to expose a public signal on `CapturedRequest` indicating the entry was a simulated failure (e.g. a `SimulatedException` / `WasSimulatedFailure` property). The core PR dennisdoomen/mockly#136 records the failed call in `Requests` but may not yet expose such a flag — confirm, and if missing, file/extend a small core change first. Implement after dennisdoomen/mockly#116 (PR #136) is merged and a new Mockly package is published.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.