public void ButtonClick()
        {
            Form form = new ButtonTestForm();

            form.Show();
            ButtonTester button = new ButtonTester("myButton", form);
            LabelTester  label  = new LabelTester("myLabel", form);

            Assert.AreEqual("0", label.Text);
            button.Click();
            Assert.AreEqual("1", label.Text);
        }
Beispiel #2
0
        public void PressEnterClicksButton()
        {
            Form form = new ButtonTestForm();

            form.Show();
            LabelTester  label  = new LabelTester("myLabel", form);
            ButtonTester button = new ButtonTester("myButton", form);

            Assert.AreEqual("0", label.Text);

            Keyboard.UseOn(button);
            Keyboard.Click(Key.RETURN);

            Assert.AreEqual("1", label.Text);
        }