Exemplo n.º 1
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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
        public void TextBox()
        {
            Form form = new TextBoxTestForm();

            form.Show();

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

            Assert.AreEqual("default", box.Text);

            Keyboard.UseOn(box);

            Keyboard.Click(Key.A);
            Keyboard.Click(Key.B);
            Keyboard.Click("+(c)");
            Keyboard.Click("C");

            Assert.AreEqual("abCC", box.Text);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
        public void TextBox()
        {
            Form form = new TextBoxTestForm();
            form.Show();

            TextBoxTester box = new TextBoxTester("myTextBox", form);
            Assert.AreEqual("default", box.Text);

            Keyboard.UseOn(box);

            Keyboard.Click(Key.A);
            Keyboard.Click(Key.B);
            Keyboard.Click("+(c)");
            Keyboard.Click("C");

            Assert.AreEqual("abCC", box.Text);
        }