Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Jan 08, 2008 02:15 PM|LINK
I am just writing my first unit test to simply test the index of my home controller.
There is a hell of a lot of interfaces I have to mock in order to run this test.
Has anybody any clues how to cut down the amount of code I will need to write.
So far I have this in my TestFixtureSetUp:
_mockContext = _mockRepository.DynamicMock<
_mockViewFactory = _mockRepository.DynamicMock<
And hen in my test I have:
homeController.ControllerContext = contextMock;
homeController.ViewFactory = _mockViewFactory;
That is a lot of mocking. Obviously I will write helper methods but it is quite a lot of boiler plate to be running each time.
Anybody come up with a good answer.