I have a helper that generates some links and wanted to be able to test that functionality. The difficult thing is that the helper delgates to UrlHelper which Delegates to Controller and to UrlBuilder.
Thanks to the new testing functionality in MonoRail this was quite easy
Heres's part of my test fixture.
[TestFixture]
public class NavigationHelperFixtures : Castle.MonoRail.TestSupport.BaseControllerTest {
private NavigationHelper helper;
private TestController controller;
[SetUp]
public void Setup() {
helper = new NavigationHelper();
controller = new TestController();
PrepareController(controller, "test", "index");
helper.SetController(controller);
}
}
This will let me call my helper methods that call UrlHelper without problems.
Technorati tags:
Castle,
MonoRail