private void AssertPolyGestureMatches(PolyGesture expectedGesture, PolyGesture actualGesture) { Assert.Equal(expectedGesture.Key, actualGesture.Key); Assert.Equal(expectedGesture.MouseAction, actualGesture.MouseAction); Assert.Equal(expectedGesture.ModifierKeys, actualGesture.ModifierKeys); Assert.Equal(expectedGesture.Type, actualGesture.Type); }
public void Set_Type_InvalidGestureType_ShouldThrowArgumentException() { //Arrange var p = new PolyGesture(Key.A, ModifierKeys.Control); //Act and Assert Assert.Throws <ArgumentException>(() => p.Type = (GestureType)int.MaxValue); }
public void Matches_NullArgument_ShouldReturnFalse() { //Arrange var p = new PolyGesture(); //Act var actual = p.Matches(null, null); //Assert Assert.False(actual); }
public void Matches_InvalidInputEventArgsType_ShouldReturnFalse() { //Arrange var p = new PolyGesture { Type = GestureType.KeyGesture }; //Act var actual = p.Matches(null, new InputEventArgs(new TestDevice(), 0)); //Assert Assert.False(actual); }
protected override void OnMouseDown(MouseButtonEventArgs e) { Focus(); if (startNewRecording) { StartNewRecording(); } if (!recordingKeyCombination) { //Do not record MouseActions that are not supported. var action = PolyGesture.GetExtendedMouseAction(e); if (!UNSUPPORTED_MOUSE_ACTIONS.Contains(action)) { if (!recordingMouseCombination) { recordingMouseCombination = true; } MouseAction = action; EnsureCorrectResultType(); } } }
public void IsDefinedGestureType_ReturnsCorrectValue(GestureType type, bool expected) { Assert.Equal(expected, PolyGesture.IsDefinedGestureType(type)); }