public void RipModule_2() { ModuleMenuReader menuSystem = new ModuleMenuReader("TestModule.xml"); foreach (var item in menuSystem.RootMenu.Menus) { if (item.Menus.Length > 0) { foreach (var subItem in item.Menus) { if (subItem.CommandItem != null) { System.Diagnostics.Debug.WriteLine($"{subItem.Command} \t {subItem.CommandItem.Execute} \t {subItem.CommandItem.DisplayName}"); } } } else { if (item.CommandItem != null) { System.Diagnostics.Debug.WriteLine($"{item.Command} \t {item.CommandItem.Execute} \t {item.CommandItem.DisplayName}"); } } } Assert.IsTrue(menuSystem.RootMenu != null); }
public void GetTopLevelMenus() { ModuleMenuReader menuSystem = new ModuleMenuReader("ReportsModule.xml"); Assert.IsInstanceOfType(menuSystem.RootMenu, typeof(ModuleMenu)); Assert.AreEqual("&Reports", menuSystem.RootMenu.Text); }
public void RipModule() { string section = "Section"; string subsection = "SubSection"; ModuleMenuReader menuSystem = new ModuleMenuReader("TestModule.xml"); foreach (var item in menuSystem.RootMenu.Menus) { if (item.Menus.Length > 0) { foreach (var subItem in item.Menus) { System.Diagnostics.Debug.WriteLine($"{section},{subsection},{subItem.Command},{item.Text} -> {subItem.Text}"); } } else { System.Diagnostics.Debug.WriteLine($"{section},{subsection},{item.Command},{item.Text}"); } } Assert.IsTrue(menuSystem.RootMenu != null); }
public void GetDescriptionOfModule() { ModuleMenuReader menuSystem = new ModuleMenuReader("ReportsModule.xml"); Assert.AreEqual("Reports Module", menuSystem.Description); }
public void GetNameOfModule() { ModuleMenuReader menuSystem = new ModuleMenuReader("ReportsModule.xml"); Assert.AreEqual("ReportsModule", menuSystem.Name); }
public void GetAllMenus() { ModuleMenuReader menuSystem = new ModuleMenuReader("ReportsModule.xml"); Assert.IsTrue(menuSystem.RootMenu.Menus.Length > 0); }