public void Setup() { _controllerContext = new ControllerContext { HttpContext = MvcMockHelpers.DynamicHttpContextBase() }; _service = new EmailTemplateService(); }
public void Setup() { MvcViewEngines.Engines.Clear(); MvcViewEngines.Engines.Add(MockRepository.GenerateMock <IViewEngine>()); _controllerContext = new ControllerContext { HttpContext = MvcMockHelpers.DynamicHttpContextBase(), Controller = MockRepository.GenerateStub <ControllerBase>() }; _controllerContext.Controller.ViewData = new ViewDataDictionary(); _controllerContext.Controller.TempData = new TempDataDictionary(); _service = new EmailTemplateService(); Response.Stub(x => x.Filter).PropertyBehavior(); Response.Expect(x => x.ContentEncoding).Return(Encoding.UTF8); }
public void Setup() { _urlHelper = new UrlHelper(new RequestContext(MvcMockHelpers.DynamicHttpContextBase(), new RouteData()), new RouteCollection()); _urlHelper.RequestContext.HttpContext.Response.Stub(o => o.ApplyAppPathModifier(null)).IgnoreArguments().Do((Func <string, string>)(s => s)); _urlHelper.RouteCollection.MapRoute("default", "{controller}/{action}/{id}", new { controller = "home", action = "index", id = "" }); }