Example #1
0
        public void CanDefineNamedMenuesWithoutCommands()
        {
            DemoModuleLoader resolve = (DemoModuleLoader)container.Resolve <IModuleLoader>();

            Assert.AreEqual("Help", resolve.Items[2].Name);
            Assert.IsNull(resolve.Items[2].Command);
        }
Example #2
0
        public void WillTranslateFromShortcutTextToKeysEnum()
        {
            DemoModuleLoader resolve = (DemoModuleLoader)container.Resolve <IModuleLoader>();

            Assert.AreEqual(Keys.Alt | Keys.F4, resolve.Items[0].ShortcutKey);
            Assert.AreEqual(Keys.F1, resolve.Items[1].ShortcutKey);
        }
        public void Can_define_menu_names_without_requiring_a_command()
        {
            DemoModuleLoader resolve = (DemoModuleLoader)container.Resolve <IModuleLoader>();

            Assert.AreEqual("Help", resolve.Items[2].Name);
            Assert.IsNull(resolve.Items[2].Command);
        }
        public void Can_specify_menus_names_and_command_names_using_declerative_configuration()
        {
            DemoModuleLoader resolve = (DemoModuleLoader)container.Resolve <IModuleLoader>();

            Assert.AreEqual("File_Exit", resolve.Items[0].Name);
            Assert.AreEqual("File_Exit", resolve.Items[0].CommandName);
            Assert.AreEqual("File", resolve.Items[0].Parent);

            Assert.AreEqual("Help_About", resolve.Items[1].Name);
            Assert.AreEqual("Help_About", resolve.Items[1].CommandName);
            Assert.AreEqual("Help", resolve.Items[1].Parent);
        }
Example #5
0
        public void WillFillTheMenuItemsFromConfiguration()
        {
            DemoModuleLoader resolve = (DemoModuleLoader)container.Resolve <IModuleLoader>();

            Assert.AreEqual("File_Exit", resolve.Items[0].Name);
            Assert.AreEqual("File_Exit", resolve.Items[0].Command);
            Assert.AreEqual("File", resolve.Items[0].Parent);
            Assert.AreEqual("F4, Alt", resolve.Items[0].Shortcut);

            Assert.AreEqual("Help_About", resolve.Items[1].Name);
            Assert.AreEqual("Help_About", resolve.Items[1].Command);
            Assert.AreEqual("Help", resolve.Items[1].Parent);
            Assert.AreEqual("F1", resolve.Items[1].Shortcut);
        }
Example #6
0
        public void CanDefineMenuWithoutShortcutKey()
        {
            DemoModuleLoader resolve = (DemoModuleLoader)container.Resolve <IModuleLoader>();

            Assert.IsNull(resolve.Items[2].ShortcutKey);
        }
Example #7
0
        public void CanSetMenuTextFromConfig()
        {
            DemoModuleLoader resolve = (DemoModuleLoader)container.Resolve <IModuleLoader>();

            Assert.AreEqual("H&elp", resolve.Items[2].Text);
        }
Example #8
0
        public void EmptyShortCutWillBeInterpretedAsNullShortcutKey()
        {
            DemoModuleLoader resolve = (DemoModuleLoader)container.Resolve <IModuleLoader>();

            Assert.IsNull(resolve.Items[3].ShortcutKey);
        }
        public void Can_specify_menu_header_from_declerative_configuration()
        {
            DemoModuleLoader resolve = (DemoModuleLoader)container.Resolve <IModuleLoader>();

            Assert.AreEqual("H&elp", resolve.Items[2].Header);
        }