예제 #1
0
        public void GrabMenuWithAction()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\MenuType1.Xml").MenuItems;

            Assert.That(menu, Has.Count.EqualTo(2));
            Assert.That(menu[1].MenuItems, Has.Count.EqualTo(1));
        }
예제 #2
0
        public void GrabMenuWithActionUrl()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\MenuType1.Xml").MenuItems;

            Assert.That(menu, Has.Count.EqualTo(2));
            Assert.That(menu[1].MenuItems[0], Has.Property("Url").EqualTo("/Photo/ManageAlbum"));
        }
예제 #3
0
        public void GrabMenuWithSubMenu()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\MenuH1.Xml").MenuItems;

            Assert.That(menu, Has.Count.EqualTo(1));
            Assert.That(menu[0], Has.Property("Text").EqualTo("administration"));
            Assert.That(menu[0].MenuItems, Has.Count.EqualTo(2));
        }
예제 #4
0
        public void GrabBasicMenu()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\BaseMenu1.Xml").MenuItems;

            Assert.That(menu, Has.Count.EqualTo(2));
            Assert.That(menu[0], Has.Property("Url").EqualTo("/Login.aspx"));
            Assert.That(menu[0], Has.Property("Text").EqualTo("Login Page"));
        }
예제 #5
0
        public void GrabMenuWithSubMenuUrlAndText()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\MenuH1.Xml").MenuItems;

            Assert.That(menu[0].MenuItems[0].Text, Is.EqualTo("Login Page"));
            Assert.That(menu[0].MenuItems[1].Text, Is.EqualTo("Registration Page"));
            Assert.That(menu[0].MenuItems[0], Has.Property("Url").EqualTo("/Login.aspx"));
            Assert.That(menu[0].MenuItems[1], Has.Property("Url").EqualTo("/CreateUser.aspx"));
        }
예제 #6
0
        public void GrabMenuWithSubMenuTypes()
        {
            MasterLogic     sut  = new MasterLogic(new MyTestUrlHelper());
            List <MenuItem> menu = sut.CreateMenu("SampleFiles\\MenuH1.Xml").MenuItems;

            Assert.That(menu, Has.Count.EqualTo(1));
            Assert.That(menu[0], Is.TypeOf(typeof(MenuItem)));
            Assert.That(menu[0].MenuItems[0], Is.TypeOf(typeof(MenuLink)));
            Assert.That(menu[0].MenuItems[1], Is.TypeOf(typeof(MenuLink)));
        }
        public JsonResult Menu()
        {
            MasterLogic mastermodel = new MasterLogic(new MvcRouteHelper(Url));

            return(Json(mastermodel.CreateMenu(Path.Combine(Global.PhysicalPath, "WebMvcSitemap.Xml"))));
        }