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(); }
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); }