public void SetUp() { path = new ViewPath { ViewName = "something" }; var render = new WebFormView(path.ViewName); var container = new Container(x => { x.For<IActionBehavior>().Use(new ObjectDefInstance(render.As<IContainerModel>().ToObjectDef(DiagnosticLevel.None))); x.For<IWebFormsControlBuilder>().Use<WebFormsControlBuilder>(); x.For<IWebFormRenderer>().Use<WebFormRenderer>(); x.For<HttpContextBase>().Use(() => new FakeHttpContext()); x.For<IOutputWriter>().Use<OutputWriter>(); x.For<IFubuRequest>().Use<InMemoryFubuRequest>(); x.For<IPageActivator>().Use<PageActivator>(); x.For<IPageActivationRules>().Use<PageActivationRuleCache>(); x.For<IServiceLocator>().Use<StructureMapServiceLocator>(); x.For<IHttpWriter>().Use(new NulloHttpWriter()); x.For<IFileSystem>().Use<FileSystem>(); }); behavior = container.GetInstance<IActionBehavior>(); }
public void SetUp() { path = new ViewPath { ViewName = "something" }; var render = new WebFormView(path.ViewName); var container = new Container(x => { x.For <IActionBehavior>().Use(new ObjectDefInstance(render.As <IContainerModel>().ToObjectDef(DiagnosticLevel.None))); x.For <IWebFormsControlBuilder>().Use <WebFormsControlBuilder>(); x.For <IWebFormRenderer>().Use <WebFormRenderer>(); x.For <HttpContextBase>().Use(() => new FakeHttpContext()); x.For <IOutputWriter>().Use <OutputWriter>(); x.For <IFubuRequest>().Use <InMemoryFubuRequest>(); x.For <IPageActivator>().Use <PageActivator>(); x.For <IPageActivationRules>().Use <PageActivationRuleCache>(); x.For <IServiceLocator>().Use <StructureMapServiceLocator>(); x.For <IHttpWriter>().Use(new NulloHttpWriter()); x.For <IFileSystem>().Use <FileSystem>(); }); behavior = container.GetInstance <IActionBehavior>(); }
public void create_from_view_type() { var view = new WebFormView(typeof(FakeWebView)); view.ViewName.ShouldEqual(typeof(FakeWebView).ToVirtualPath()); view.InputType.ShouldEqual(typeof(InputModel)); view.As <IMayHaveInputType>().InputType().ShouldEqual(typeof(InputModel)); }
public void SetUp() { path = new ViewPath { ViewName = "something" }; var render = new WebFormView(path.ViewName); var container = new Container(x => { x.For <IActionBehavior>().Use(new ObjectDefInstance(render.As <IContainerModel>().ToObjectDef())); x.For <IWebFormsControlBuilder>().Use <WebFormsControlBuilder>(); x.For <IWebFormRenderer>().Use <WebFormRenderer>(); x.For <IOutputWriter>().Use <HttpResponseOutputWriter>(); x.For <IFubuRequest>().Use <InMemoryFubuRequest>(); x.For <IViewActivator>().Use <NulloViewActivator>(); }); behavior = container.GetInstance <IActionBehavior>(); }
public void SetUp() { path = new ViewPath { ViewName = "something" }; var render = new WebFormView(path.ViewName); var container = new Container(x => { x.For<IActionBehavior>().Use(new ObjectDefInstance(render.As<IContainerModel>().ToObjectDef())); x.For<IWebFormsControlBuilder>().Use<WebFormsControlBuilder>(); x.For<IWebFormRenderer>().Use<WebFormRenderer>(); x.For<IOutputWriter>().Use<HttpResponseOutputWriter>(); x.For<IFubuRequest>().Use<InMemoryFubuRequest>(); x.For<IPageActivator>().Use<PageActivator>(); x.For<IPageActivationRules>().Use<PageActivationRuleCache>(); x.For<IServiceLocator>().Use<StructureMapServiceLocator>(); }); behavior = container.GetInstance<IActionBehavior>(); }