public void PinchInProgress_is_false_when_pinch_state_changed(GestureState state) { var recognizer = new PlatformPinchRecognizerStub(new object()); recognizer.OnPinchingBegan(0, 0); recognizer.OnPinchingStateChanged(state); recognizer.PinchInProgress.Should().BeFalse("since the pinch state changed"); }
public void Pinching_emits_when_OnPinchingStateChanged_invoked() { var recognizer = new PlatformPinchRecognizerStub(new object()); var pinch = default(PinchEvent); recognizer.Pinching.Skip(1).Take(1).Subscribe(ev => pinch = ev); recognizer.OnPinchingBegan(0, 0); recognizer.OnPinchingStateChanged(GestureState.Ended); pinch.State.Should().Be(GestureState.Ended, "because pinching state changed"); }
public void OnPinchingStateChanged_throws_if_pinch_not_in_progress() { var recognizer = new PlatformPinchRecognizerStub(new object()); Assert.Throws <InvalidOperationException>(() => recognizer.OnPinchingStateChanged(GestureState.Ended)); }