コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Screen.Test.cs プロジェクト: pr0gramm3r1/AngryTanks
    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);
    }