public void PinchInProgress_is_true_when_pinch_begins() { var recognizer = new PlatformPinchRecognizerStub(new object()); recognizer.OnPinchingBegan(0, 0); recognizer.PinchInProgress.Should().BeTrue("since the pinch has begun"); }
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 OnPinchingBegan_throws_if_pinch_already_in_progress() { var recognizer = new PlatformPinchRecognizerStub(new object()); recognizer.OnPinchingBegan(0, 0); Assert.Throws <InvalidOperationException>(() => recognizer.OnPinchingBegan(0, 0)); }
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 Pinching_emits_when_OnPinchingBegan_invoked() { var recognizer = new PlatformPinchRecognizerStub(new object()); var pinch = default(PinchEvent); recognizer.Pinching.Take(1).Subscribe(ev => pinch = ev); recognizer.OnPinchingBegan(1, 2); pinch.State.Should().Be(GestureState.Began, "because pinching began"); pinch.Origin.X.Should().Be(1); pinch.Origin.Y.Should().Be(2); }
public void OnPinchingStateChanged_throws_if_pinch_not_in_progress() { var recognizer = new PlatformPinchRecognizerStub(new object()); Assert.Throws <InvalidOperationException>(() => recognizer.OnPinchingStateChanged(GestureState.Ended)); }