Example #1
0
        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);
        }
Example #2
0
        public void GetTopLevelMenus()
        {
            ModuleMenuReader menuSystem = new ModuleMenuReader("ReportsModule.xml");

            Assert.IsInstanceOfType(menuSystem.RootMenu, typeof(ModuleMenu));
            Assert.AreEqual("&Reports", menuSystem.RootMenu.Text);
        }
Example #3
0
        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);
        }
Example #4
0
        public void GetDescriptionOfModule()
        {
            ModuleMenuReader menuSystem = new ModuleMenuReader("ReportsModule.xml");

            Assert.AreEqual("Reports Module", menuSystem.Description);
        }
Example #5
0
        public void GetNameOfModule()
        {
            ModuleMenuReader menuSystem = new ModuleMenuReader("ReportsModule.xml");

            Assert.AreEqual("ReportsModule", menuSystem.Name);
        }
Example #6
0
        public void GetAllMenus()
        {
            ModuleMenuReader menuSystem = new ModuleMenuReader("ReportsModule.xml");

            Assert.IsTrue(menuSystem.RootMenu.Menus.Length > 0);
        }