Exemplo n.º 1
0
        public PanelBarRenderingTest()
        {
            Mock <TextWriter>     textWriter = new Mock <TextWriter>();
            Mock <HtmlTextWriter> writer     = new Mock <HtmlTextWriter>(textWriter.Object);

            builder = new Mock <INavigationComponentHtmlBuilder <PanelBarItem> >();
            builder.Setup(r => r.Build()).Returns(() => new HtmlElement("ul"));
            builder.Setup(r => r.ItemTag(It.IsAny <PanelBarItem>())).Returns(() => new HtmlElement("li"));
            builder.Setup(r => r.ItemContentTag(It.IsAny <PanelBarItem>())).Returns(() => new HtmlElement("div"));
            builder.Setup(r => r.ItemInnerContentTag(It.IsAny <PanelBarItem>(), It.IsAny <bool>())).Returns(() => new HtmlElement("a"));
            builder.Setup(r => r.ChildrenTag(It.IsAny <PanelBarItem>())).Returns(() => new HtmlElement("ul"));

            panelBar      = PanelBarTestHelper.CreatePanelbar(writer.Object, builder.Object);
            panelBar.Name = "PanelBar1";

            panelBar.Items.Add(new PanelBarItem {
                Text = "PanelBarItem1", RouteName = "ProductList"
            });
            panelBar.Items.Add(new PanelBarItem {
                Text = "PanelBarItem2", RouteName = "ProductList"
            });
            panelBar.Items.Add(new PanelBarItem {
                Text = "PanelBarItem3", RouteName = "ProductList"
            });

            var httpContext = new Mock <HttpContextBase>();

            panelBar.ViewContext.HttpContext = httpContext.Object;
            httpContext.Setup(h => h.Response.Output).Returns(TextWriter.Null);
            currentUri = new Uri("http://localhost/$(SESSION)/app/Grid/Basic");
            httpContext.Setup(h => h.Request.Url).Returns(() => currentUri);
        }
Exemplo n.º 2
0
        public PanelBarBuilderTests()
        {
            Mock <HtmlTextWriter> writer = new Mock <HtmlTextWriter>(TextWriter.Null);

            panelBar = PanelBarTestHelper.CreatePanelbar(writer.Object, null);
            builder  = new PanelBarBuilder(panelBar);
        }
        public PanelBarHtmlBuilderTests()
        {
            writer = new Mock <HtmlTextWriter>(TextWriter.Null);

            panelBar      = PanelBarTestHelper.CreatePanelbar(writer.Object, null);
            panelBar.Name = "PanelBar1";

            item = new PanelBarItem();

            renderer = new PanelBarHtmlBuilder(panelBar, new Mock <IActionMethodCache>().Object);
        }
 public PanelBarSettingsVerificationTests()
 {
     panelbar      = PanelBarTestHelper.CreatePanelbar();
     panelbar.Name = "PanelBar";
 }