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)); }
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")); }
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)); }
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")); }
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")); }
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")))); }