public virtual void Init()
{
mocks = new MockRepository();
var services = new StubMonoRailServices();
services.ViewSourceLoader = new FileAssemblyViewSourceLoader("MonoRail.Tests.Views");
services.AddService(typeof(IViewSourceLoader), services.ViewSourceLoader);
viewComponentFactory = new DefaultViewComponentFactory();
viewComponentFactory.Initialize();
services.AddService(typeof(IViewComponentFactory), viewComponentFactory);
services.AddService(typeof(IViewComponentRegistry), viewComponentFactory.Registry);
var settings = new SparkSettings();
engine = new SparkViewEngine(settings);
services.AddService(typeof(ISparkViewEngine), engine);
factory = new SparkViewFactory();
factory.Service(services);
controller = MockRepository.GenerateMock<IController>();
controllerContext = new ControllerContext();
var request = new StubRequest();
request.FilePath = "";
var response = new StubResponse();
engineContext = new StubEngineContext(request, response, new UrlInfo("", "Home", "Index", "/", "castle"));
engineContext.AddService(typeof(IViewComponentFactory), viewComponentFactory);
engineContext.AddService(typeof(IViewComponentRegistry), viewComponentFactory.Registry);
}