asp.net mvc rhino mocks mocking httprequest values
- by Matthew
Hi Is there a way to mock request params, what is the best approach when testing to create fake request values in order to run a test
would some thing like this work?
_context = MockRepository.GenerateStub<HttpContext>();
request = MockRepository.GenerateStub<HttpRequest>();
var collection = new NameValueCollection();
collection.Add("", "");
SetupResult.For(request.Params).Return(collection);
SetupResult.For(_context.Request).Return(request);