public void Key_down_events_trigger_cheet_sequences() { // Given var uiElement = new UIElement(); uiElement.PreviewKeyDown += cheet.OnKeyDown; cheet.Map("a b c", callbacks.Done); // When uiElement.SimulateKeyPresses(Key.A, Key.B, Key.C); // Then A.CallTo(() => callbacks.Done()).MustHaveHappened(); }
public void Same_key_events_handled_multiple_times_does_not_prevent_sequence_completion() { // Given var uiElement = new UIElement(); uiElement.PreviewKeyDown += cheet.OnKeyDown; uiElement.PreviewKeyDown += cheet.OnKeyDown; cheet.Map("a b c", callbacks.Done); // When uiElement.SimulateKeyPresses(Key.A, Key.B, Key.C); // Then A.CallTo(() => callbacks.Done()).MustHaveHappened(); }