Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: expose collected requests #82

Open
johnknoop opened this issue Nov 3, 2020 · 1 comment
Open

Feature request: expose collected requests #82

johnknoop opened this issue Nov 3, 2020 · 1 comment

Comments

@johnknoop
Copy link

Hi and thanks for a great library!

In order to have good failure messages in my tests, I generally do this:

httpMock.Fallback
    .Respond(req => throw new Exception($"No matcher found: {req.Method} {req.RequestUri.PathAndQuery}"));

But some of my tests contain tens of different HTTP requests, and in order for a failing test to point me in the right direction, it would be great if I could get the last matched request from the mock, so that I can add that to my failure message, like:

Last successful HTTP request: POST /somepath?my=query

@domn1995
Copy link

domn1995 commented Aug 21, 2024

I have a similar use-case, but my ideal solution would be to expose a history of all matched requests rather than just the last one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants