Beispiel #1
0
        public void TestDefaultSettings()
        {
            ShortcutHandler manager = new ShortcutHandler();

            using (FileStream stream = File.OpenRead(UNPACK_DESTINATION + @"\Settings\DefaultSettings.xml"))
            {
                manager.Load(stream);
            }
            Assert.AreEqual(System.Windows.Forms.Shortcut.None, manager.GetShortcut("cmdNotInSettings"));
            Assert.IsTrue(manager.IsCommandInvoked("BrowserCreateNewTab", Keys.N | Keys.Control));
        }
Beispiel #2
0
        public void TestLoadValidSettingsWithNoWhitespace()
        {
            ShortcutHandler manager = new ShortcutHandler();

            using (FileStream stream = File.OpenRead(UNPACK_DESTINATION + @"\Settings\DefaultSettingsWithNoWhitespace.xml"))
            {
                manager.Load(stream);
            }

            Assert.AreEqual(Shortcut.None, manager.GetShortcut("cmdNotInSettings"));
            Assert.AreEqual(Shortcut.CtrlE, manager.GetShortcut("cmdExportFeeds"));
            Assert.IsTrue(manager.IsCommandInvoked("BrowserCreateNewTab", Keys.N | Keys.Control));
        }
Beispiel #3
0
        public void TestLoadValidSettings()
        {
            ShortcutHandler manager = new ShortcutHandler();

            using (FileStream stream = File.OpenRead(UNPACK_DESTINATION + @"\Settings\ValidShortcutSettings.xml"))
            {
                manager.Load(stream);
            }

            Assert.AreEqual(System.Windows.Forms.Shortcut.F1, manager.GetShortcut("cmdTestOne"));
            Assert.AreEqual(System.Windows.Forms.Shortcut.Ctrl4, manager.GetShortcut("cmdTestTwo"));
            Assert.IsTrue(manager.IsShortcutDisplayed("cmdTestTwo"));
            Assert.AreEqual(System.Windows.Forms.Shortcut.None, manager.GetShortcut("cmdNotInSettings"));
        }