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)); }
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")); }
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)); }