public void KeySequenceInProgress_is_false_when_KeyDown_and_KeyUp_occurs() { var recognizer = new PlatformKeyListenerStub(new object()); recognizer.OnKeyDown(Key.A); recognizer.OnKeyUp(Key.A); recognizer.KeySequenceInProgress.Should().BeFalse("since key sequence has ended"); }
public void KeyUp_emits_when_method_invoked() { var recognizer = new PlatformKeyListenerStub(new object()); var keyUp = false; recognizer.KeyUp.Take(1).Subscribe(_ => keyUp = true); recognizer.OnKeyDown(Key.A); recognizer.OnKeyUp(Key.A); keyUp.Should().BeTrue("because a key-up occurred"); }
public void OnKeyUp_throws_if_key_sequence_not_in_progress() { var recognizer = new PlatformKeyListenerStub(new object()); Assert.Throws <InvalidOperationException>(() => recognizer.OnKeyUp(Key.A)); }