In my controller I have a line of code like this
string method = HttpContext.Request.HttpMethod;
and based on if it is a GET
or POST
, method is doing different things that I want test. But first I should be able to mock this. We are using NSubstitute.
I did some research and the closest I found was this answer but none of them are using NSubstitue.
Mocking Asp.net-mvc Controller Context
Any help is appreciated.