public void CorrectlyReturnsStringAfterUpdateModifierKeys() { var inputGesture = new InputGesture(Key.A, ModifierKeys.Control | ModifierKeys.Shift); inputGesture.ToString(); inputGesture.Modifiers |= ModifierKeys.Alt; Assert.AreEqual("Alt + Control + Shift + A", inputGesture.ToString()); }
public void CorrectlyReturnsStringAfterUpdateKey() { var inputGesture = new InputGesture(Key.A, ModifierKeys.Control | ModifierKeys.Shift); inputGesture.ToString(); inputGesture.Key = Key.B; Assert.AreEqual("Control + Shift + B", inputGesture.ToString()); }
public void SecondCallExecutesFasterThanFirstOne() { var inputGesture = new InputGesture(Key.A, ModifierKeys.Control | ModifierKeys.Shift); Stopwatch stopwatch1 = new Stopwatch(); stopwatch1.Start(); inputGesture.ToString(); stopwatch1.Stop(); Stopwatch stopwatch2 = new Stopwatch(); stopwatch2.Start(); inputGesture.ToString(); stopwatch2.Stop(); Assert.Less(stopwatch2.Elapsed, stopwatch1.Elapsed); }
public void CorrectlyReturnsStringWithMultipleModifier() { var inputGesture = new InputGesture(Key.A, ModifierKeys.Control | ModifierKeys.Shift); Assert.AreEqual("Control + Shift + A", inputGesture.ToString()); }
public void CorrectlyReturnsStringWithSingleModifier() { var inputGesture = new InputGesture(Key.A, ModifierKeys.Control); Assert.AreEqual("Control + A", inputGesture.ToString()); }
public void CorrectlyReturnsStringWithoutModifiers() { var inputGesture = new InputGesture(Key.A, ModifierKeys.None); Assert.AreEqual("A", inputGesture.ToString()); }