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); }
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); }
public void Listen() { ButtonTestForm form = new ButtonTestForm(); form.Show(); FireCount = 0; Listener listener = new Listener(); listener.ListenTo(form); listener.Event += new EventHappened(EventListener); ButtonTester button = new ButtonTester("myButton", form); button.Click(); Assert.AreEqual(1, FireCount); button.Click(); Assert.AreEqual(2, FireCount); }
public void SimpleButton() { ButtonTestForm form = new ButtonTestForm(); form.Show(); TestWriter writer = new TestWriter(form); Assert.AreEqual("", writer.Test); ButtonTester button = new ButtonTester("myButton", form); button.Click(); Assert.AreEqual( @"[Test] public void Test() { ButtonTester myButton = new ButtonTester(""myButton""); myButton.Click(); }", writer.Test); }