Exemple #1
0
            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());
            }
Exemple #2
0
            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());
            }
Exemple #3
0
            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());
            }
Exemple #7
0
            public void CorrectlyReturnsStringWithMultipleModifier()
            {
                var inputGesture = new InputGesture(Key.A, ModifierKeys.Control | ModifierKeys.Shift);

                Assert.AreEqual("Control + Shift + A", inputGesture.ToString());
            }
Exemple #8
0
            public void CorrectlyReturnsStringWithSingleModifier()
            {
                var inputGesture = new InputGesture(Key.A, ModifierKeys.Control);

                Assert.AreEqual("Control + A", inputGesture.ToString());
            }
Exemple #9
0
            public void CorrectlyReturnsStringWithoutModifiers()
            {
                var inputGesture = new InputGesture(Key.A, ModifierKeys.None);

                Assert.AreEqual("A", inputGesture.ToString());
            }