public void Create_AssignsKey() { var g = CustomKeyGesture.Create(Key.A, ModifierKeys.None); Assert.AreEqual(Key.A, g.Key); Assert.AreEqual(ModifierKeys.None, g.Modifiers); }
public void DisplayString_LocalizedKey_Success() { CustomKeyGesture.SupplyLocalization(KeyGestureLocalizations.ResourceManager); var g = CustomKeyGesture.Create(Key.Home, ModifierKeys.None); Assert.AreEqual(KeyGestureLocalizations.Key_Home, g.DisplayString); }
public void DisplayString_LocalizedModifiers_Success() { CustomKeyGesture.SupplyLocalization(KeyGestureLocalizations.ResourceManager); var g = CustomKeyGesture.Create(Key.A, ModifierKeys.Control | ModifierKeys.Shift); string expected = String.Format( "{0}+{1}+A", KeyGestureLocalizations.ModifierKeys_Control, KeyGestureLocalizations.ModifierKeys_Shift ); Assert.AreEqual(expected, g.DisplayString); }
public void DisplayString_TwoModifiers_Success() { var g = CustomKeyGesture.Create(Key.A, ModifierKeys.Control | ModifierKeys.Shift); Assert.AreEqual("Ctrl+Shift+A", g.DisplayString); }
public void DisplayString_SingleModifier_Success() { var g = CustomKeyGesture.Create(Key.A, ModifierKeys.Control); Assert.AreEqual("Ctrl+A", g.DisplayString); }
public void DisplayString_NoModifiers_Success() { var g = CustomKeyGesture.Create(Key.A, ModifierKeys.None); Assert.AreEqual("A", g.DisplayString); }
public void Create_AssignsModifiers() { var g = CustomKeyGesture.Create(Key.A, ModifierKeys.Control); Assert.AreEqual(ModifierKeys.Control, g.Modifiers); }