コード例 #1
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"));
 }
コード例 #2
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));
 }
コード例 #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)));
 }
コード例 #7
0
 public JsonResult Menu()
 {
     MasterLogic mastermodel = new MasterLogic(new MvcRouteHelper(Url));
      return Json(mastermodel.CreateMenu(Path.Combine(Global.PhysicalPath,"WebMvcSitemap.Xml")));
 }