CodePrairie .NET

South Dakota .NET User Group


Testing Helpers in MonoRail

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.


public class NavigationHelperFixtures : Castle.MonoRail.TestSupport.BaseControllerTest {
	private NavigationHelper helper;
	private TestController controller;
	public void Setup() {			
		helper = new NavigationHelper();
		controller = new TestController();
		PrepareController(controller, "test", "index");

This will let me call my helper methods that call UrlHelper without problems.



Technorati tags: ,
Published Oct 24 2007, 10:44 PM by chrisortman
Filed under:


No Comments

Leave a Comment

Powered by Community Server (Commercial Edition), by Telligent Systems