public void TestAcceptAndCancelFromKeyboard() { Screen screen = new Screen(100.0f, 100.0f); CommandTestControl test = new CommandTestControl(); screen.Desktop.Children.Add(test); screen.FocusedControl = test; screen.InjectKeyPress(Keys.Escape); Assert.AreEqual(Command.Cancel, test.LastCommand); screen.InjectKeyPress(Keys.Enter); Assert.AreEqual(Command.Accept, test.LastCommand); }