Closed kesot closed 6 years ago
Ok... Will do
Hi @kesot, Looking at the tests, I can't see a use case for this change. Can you explain a bit more what you are trying to do?
IRequestVerify is an interface that is used with AssertWasCalled, and to verify how requests are made. IRequestStub is used to setup how the mock responds, and the interface strictly caters to that. It will be confusing to a user of a fluent interface if things that are not related are returned.
Well, when I setup mock I expect to have an object at the end of the fluent interface which I can use for assertion. How do you assert now headers or body of request sent to the handler?
You can assert using the AssertWasCalled extensions. See https://github.com/hibri/HttpMock/blob/master/src/HttpMock.Integration.Tests/HttpExpectationTests.cs for some examples.
It's not shipped with nuget package
Oh, I see the problem now, I was not able to find any verification methods because they are separated to the different package. But why?
Didn't want to ship a NUnit dependency with the main project, and if you are using your own testing framework it's easier to extend it.
And why do I have to depend on NUnit if I use HttpMock in MSTests for example?
You are free to use MSTest, but if you use MSTest, you can write your own extensions, using the example in the HttpMock.Verify.NUnit library. I'd like to keep the verification concerns separate from the main library.
Thanks for this @kesot :) Could you write a test(s) for this? It makes sure the functionality is not broken in future, and also it would be good to use the test as an example on how to use the functionality.