public override void SetUp() { base.SetUp(); _htmlHelper = new HtmlHelper(); _httpContext = MockRepository.GenerateStub <HttpContextBase> (); _singleView = MockRepository.GenerateStub <ISingleView>(); _singleView.Stub(stub => stub.ClientID).Return("SingleView"); _singleView.Stub(stub => stub.TopControl).Return(new PlaceHolder { ID = "TopControl" }); _singleView.Stub(stub => stub.BottomControl).Return(new PlaceHolder { ID = "BottomControl" }); _singleView.Stub(stub => stub.View).Return(new PlaceHolder { ID = "ViewControl" }); _singleView.Stub(stub => stub.ViewClientID).Return("ViewClientID"); StateBag stateBag = new StateBag(); _singleView.Stub(stub => stub.Attributes).Return(new AttributeCollection(stateBag)); _singleView.Stub(stub => stub.TopControlsStyle).Return(new Style(stateBag)); _singleView.Stub(stub => stub.BottomControlsStyle).Return(new Style(stateBag)); _singleView.Stub(stub => stub.ViewStyle).Return(new Style(stateBag)); _singleView.Stub(stub => stub.ControlStyle).Return(new Style(stateBag)); _resourceUrlFactory = new FakeResourceUrlFactory(); }
public void RenderViewInDesignMode() { PopulateControl(); _singleView.Stub(stub => stub.IsDesignMode).Return(true); AssertRendering(false, false, false, true); }
public void SetUp() { _htmlHelper = new HtmlHelper(); _httpContext = MockRepository.GenerateStub <HttpContextBase> (); _control = MockRepository.GenerateStub <ISingleView>(); _control.Stub(stub => stub.ClientID).Return("MySingleView"); _control.Stub(stub => stub.ControlType).Return("SingleView"); _control.Stub(stub => stub.TopControl).Return(new PlaceHolder { ID = "TopControl" }); _control.Stub(stub => stub.BottomControl).Return(new PlaceHolder { ID = "BottomControl" }); _control.Stub(stub => stub.View).Return(new PlaceHolder { ID = "ViewControl" }); _control.Stub(stub => stub.ViewClientID).Return("ViewClientID"); _control.Stub(stub => stub.ViewContentClientID).Return(_control.ViewClientID + "_Content"); _control.Stub(stub => stub.WrapperClientID).Return("WrapperClientID"); StateBag stateBag = new StateBag(); _control.Stub(stub => stub.Attributes).Return(new AttributeCollection(stateBag)); _control.Stub(stub => stub.TopControlsStyle).Return(new Style(stateBag)); _control.Stub(stub => stub.BottomControlsStyle).Return(new Style(stateBag)); _control.Stub(stub => stub.ViewStyle).Return(new Style(stateBag)); _control.Stub(stub => stub.ControlStyle).Return(new Style(stateBag)); var clientScriptStub = MockRepository.GenerateStub <IClientScriptManager> (); var pageStub = MockRepository.GenerateStub <IPage> (); pageStub.Stub(stub => stub.ClientScript).Return(clientScriptStub); _control.Stub(stub => stub.Page).Return(pageStub); _renderer = new SingleViewRenderer(new FakeResourceUrlFactory(), GlobalizationService, RenderingFeatures.Default); }