So the MvcContrib TestHelpers create mock versions of the following
- HttpContext
- HttpRequest
- HttpResponse
- HttpSession
- Form
- TempData
- QueryString
- ApplicationPath
- PathInfo
within a fake controller when using this kind of code
var _controller = new FooController();
var _builder = new TestControllerBuilder();
_builder.InitializeController(_controller);
But you'll notice they don't create a fake/mock Server object. Presumably there is a good reason why not. But I'm trying to stub out the Server.MapPath() method because the method in my SUT uses it and of course during the test its returning NULL.
The TestHelpers use rhino mocks (v3.5) and so am I. I know the syntax to stub out a method but how do I get the Server fake/mock object into my controller so I can stub out the method?