mockhttp
mockhttp copied to clipboard
Feature request: expose collected requests
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
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.