Beispiel #1
0
        public void TestClassicFocusSwitching()
        {
            Screen screen = new Screen(100.0f, 100.0f);

            screen.InjectCommand(Command.SelectPrevious);
            screen.InjectCommand(Command.SelectNext);
            // TODO: Implement classic focus switching and do some real testing here
        }
Beispiel #2
0
        public void TestCommandProcessing()
        {
            Screen testScreen = new Screen();

            testScreen.InjectCommand(Command.Accept);
            testScreen.InjectCommand(Command.Cancel);
            // No exception means success
        }
Beispiel #3
0
        public void TestFocusSwitchingWithoutFocusedControl()
        {
            Screen screen = new Screen(100.0f, 100.0f);

            screen.InjectCommand(Command.Down);
            // No exception means success
        }
Beispiel #4
0
        public void TestNoFocusChangeOnHandledDirectionalCommand()
        {
            Screen screen = new Screen(100.0f, 100.0f);
            Mock <IInputReceiver> mockedReceiver = mockReceiver(screen);
            DelegatingControl     one            = new DelegatingControl(mockedReceiver.MockObject);

            one.Bounds = new UniRectangle(40, 10, 20, 20);
            Controls.Desktop.ButtonControl two = new Controls.Desktop.ButtonControl();
            two.Bounds = new UniRectangle(40, 40, 20, 20);

            screen.Desktop.Children.Add(one);
            screen.Desktop.Children.Add(two);

            mockedReceiver.Expects.One.MethodWith(m => m.InjectCommand(Command.Down));

            screen.FocusedControl = one;
            screen.InjectCommand(Command.Down);

            Assert.AreSame(one, screen.FocusedControl);

            this.mockery.VerifyAllExpectationsHaveBeenMet();
        }
Beispiel #5
0
 public void TestClassicFocusSwitching() {
   Screen screen = new Screen(100.0f, 100.0f);
   screen.InjectCommand(Command.SelectPrevious);
   screen.InjectCommand(Command.SelectNext);
   // TODO: Implement classic focus switching and do some real testing here
 }
Beispiel #6
0
 public void TestFocusSwitchingWithDisconnectedControl() {
   Screen screen = new Screen(100.0f, 100.0f);
   screen.FocusedControl = new Controls.Control();
   screen.InjectCommand(Command.Down);
   // No exception means success
 }
Beispiel #7
0
    public void TestNoFocusChangeOnHandledDirectionalCommand() {
      Screen screen = new Screen(100.0f, 100.0f);
      IInputReceiver mockedReceiver = mockReceiver(screen);
      DelegatingControl one = new DelegatingControl(mockedReceiver);
      one.Bounds = new UniRectangle(40, 10, 20, 20);
      Controls.Desktop.ButtonControl two = new Controls.Desktop.ButtonControl();
      two.Bounds = new UniRectangle(40, 40, 20, 20);

      screen.Desktop.Children.Add(one);
      screen.Desktop.Children.Add(two);

      Expect.Once.On(mockedReceiver).Method("InjectCommand").WithAnyArguments();

      screen.FocusedControl = one;
      screen.InjectCommand(Command.Down);

      Assert.AreSame(one, screen.FocusedControl);

      this.mockery.VerifyAllExpectationsHaveBeenMet();
    }
Beispiel #8
0
 public void TestCommandProcessing() {
   Screen testScreen = new Screen();
   testScreen.InjectCommand(Command.Accept);
   testScreen.InjectCommand(Command.Cancel);
   // No exception means success
 }