public void Dupes() { string Storage = _TestSingleTon.TESTDATABASE; List <KeyData> Hotkeys = new List <KeyData>(); Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida")); HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); hotKeyConfig.GetConfigPanel(); Assert.AreEqual(0, hotKeyConfig.Duplicates, "1"); Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidb")); hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); hotKeyConfig.GetConfigPanel(); Assert.AreEqual(1, hotKeyConfig.Duplicates, "2"); Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.X, Constants.BLANK, false, "dualscreenguidc")); hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); hotKeyConfig.GetConfigPanel(); Assert.AreEqual(1, hotKeyConfig.Duplicates, "2b"); Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.C, Constants.BLANK, false, "dualscreenguidd")); Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.C, Constants.BLANK, false, "dualscreenguide")); hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); hotKeyConfig.GetConfigPanel(); Assert.AreEqual(2, hotKeyConfig.Duplicates, "3"); }
public static void SaveHotkeyConfig(HotKeyConfig cfg) { var sw = new StreamWriter(new FileStream(AppDomain.CurrentDomain.BaseDirectory + "cfg", FileMode.Truncate)); sw.WriteLine(cfg.enabled.ToString() + ";" + cfg.hotkeyIndex.ToString()); sw.Close(); }
public void BlankDatabase() { string Storage = CoreUtilities.Constants.BLANK; List <KeyData> Hotkeys = new List <KeyData>(); Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida")); HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); }
public void AssureNoDamageDone() { // lame test but you never know. Makes sure that nothing is lost after creating the panel in the original hotkeys string Storage=_TestSingleTon.TESTDATABASE; List<KeyData> Hotkeys = new List<KeyData>(); Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida")); Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidb")); Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidc")); Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidd")); int count = Hotkeys.Count; HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); hotKeyConfig.GetConfigPanel(); Assert.AreEqual(count, Hotkeys.Count); }
public void AssureNoDamageDone() { // lame test but you never know. Makes sure that nothing is lost after creating the panel in the original hotkeys string Storage = _TestSingleTon.TESTDATABASE; List <KeyData> Hotkeys = new List <KeyData>(); Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida")); Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidb")); Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidc")); Hotkeys.Add(new KeyData("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidd")); int count = Hotkeys.Count; HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); hotKeyConfig.GetConfigPanel(); Assert.AreEqual(count, Hotkeys.Count); }
public void Dupes() { string Storage=_TestSingleTon.TESTDATABASE; List<KeyData> Hotkeys = new List<KeyData>(); Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida")); HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); hotKeyConfig.GetConfigPanel(); Assert.AreEqual(0, hotKeyConfig.Duplicates,"1"); Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguidb")); hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); hotKeyConfig.GetConfigPanel(); Assert.AreEqual(1, hotKeyConfig.Duplicates,"2"); Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.X, Constants.BLANK, false, "dualscreenguidc")); hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); hotKeyConfig.GetConfigPanel(); Assert.AreEqual(1, hotKeyConfig.Duplicates,"2b"); Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.C, Constants.BLANK, false, "dualscreenguidd")); Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.C, Constants.BLANK, false, "dualscreenguide")); hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); hotKeyConfig.GetConfigPanel(); Assert.AreEqual(2, hotKeyConfig.Duplicates,"3"); }
public void BlankDatabase() { string Storage=CoreUtilities.Constants.BLANK; List<KeyData> Hotkeys = new List<KeyData>(); Hotkeys.Add (new KeyData ("Dual Screen", null, Keys.Control, Keys.W, Constants.BLANK, false, "dualscreenguida")); HotKeyConfig hotKeyConfig = new HotKeyConfig(Storage, ref Hotkeys, Layout.MasterOfLayouts.GetDatabaseType); }