Ejemplo n.º 1
0
        public void TextBoxEnter()
        {
            Form form = new TextBoxTestForm();

            form.Show();
            TestWriter writer = new TestWriter(form);

            Assert.AreEqual("", writer.Test);

            TextBoxTester textBox = new TextBoxTester("myTextBox", form);

            //doing 2 of these tests the collapsing processor.
            textBox.Enter("abc");
            textBox.Enter("abcd");

            Assert.AreEqual(
                @"[Test]
public void Test()
{

	TextBoxTester myTextBox = new TextBoxTester(""myTextBox"");

	myTextBox.Enter(""abcd"");

}",
                writer.Test);
        }
Ejemplo n.º 2
0
        public void TextBoxEnterMultiline()
        {
            Form form = new TextBoxTestForm();

            form.Show();
            TestWriter writer = new TestWriter(form);

            Assert.AreEqual("", writer.Test);

            TextBoxTester textBox = new TextBoxTester("myTextBox", form);

            textBox.Properties.Multiline = true;

            textBox.Enter("abc\nabcd\nabcde");

            Assert.AreEqual(
                @"[Test]
public void Test()
{

	TextBoxTester myTextBox = new TextBoxTester(""myTextBox"");

	myTextBox.Enter(""abc\nabcd\nabcde"");

}",
                writer.Test);
        }
        public KeyboardControllerTest()
        {
            textBoxForm = new TextBoxTestForm();
            textBoxForm.Show();

            textBoxTester = new ControlTester("myTextBox");
            Assert.Equal("default", textBoxTester.Text);

            keyboardController = new KeyboardController(textBoxTester);
        }
Ejemplo n.º 4
0
        public void ProgrammaticallyChangeTextIsNotRecorded()
        {
            Form form = new TextBoxTestForm();

            form.Show();
            TestWriter writer = new TestWriter(form);

            Assert.AreEqual("", writer.Test);

            TextBoxTester textBox = new TextBoxTester("myTextBox", form);

            textBox.Properties.Text = "abc";

            Assert.AreEqual(@"", writer.Test);
        }
Ejemplo n.º 5
0
        public void ProgrammaticallyChangeTextIsNotRecordedTwoBoxes()
        {
            Form form = new TextBoxTestForm();

            form.Show();
            TestWriter writer = new TestWriter(form);

            Assert.AreEqual("", writer.Test);

            TextBoxTester anotherBox = new TextBoxTester("anotherTextBox", form);

            anotherBox.FireEvent("Enter");

            TextBoxTester textBox = new TextBoxTester("myTextBox", form);

            textBox.Properties.Text = "abc";

            anotherBox.FireEvent("Leave");

            Assert.AreEqual(@"", writer.Test);
        }