Exemplo n.º 1
0
        public void MouseGesture_TryParse_FailsForInvalidStringsWithRepeatedModifiers()
        {
            RuntimeHelpers.RunClassConstructor(typeof(UltravioletStrings).TypeHandle);

            var gesture = default(MouseGesture);
            var result  = MouseGesture.TryParse("Ctrl+Ctrl+LeftClick", out gesture);

            TheResultingValue(result).ShouldBe(false);
            TheResultingObject(gesture).ShouldBeNull();
        }
Exemplo n.º 2
0
        public void MouseGesture_TryParse_SucceedsForValidStrings_WithModifierKeys()
        {
            RuntimeHelpers.RunClassConstructor(typeof(UltravioletStrings).TypeHandle);

            var gesture = default(MouseGesture);
            var result  = MouseGesture.TryParse("Ctrl+Alt+MiddleDoubleClick", out gesture);

            TheResultingValue(result).ShouldBe(true);
            TheResultingValue(gesture.MouseAction).ShouldBe(MouseAction.MiddleDoubleClick);
            TheResultingValue(gesture.Modifiers).ShouldBe(ModifierKeys.Control | ModifierKeys.Alt);
        }