public KeyboardControllerTest()
        {
            textBoxForm = new TextBoxTestForm();
            textBoxForm.Show();

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

            keyboardController = new KeyboardController(textBoxTester);
        }
Exemplo n.º 2
0
        public void TextBox()
        {
            TextBoxTestForm f = new TextBoxTestForm();

            f.Show();
            TextBoxTester box = new TextBoxTester("myTextBox");

            Assert.Equal("default", box.Text);
            box.Enter("Text");
            Assert.Equal("Text", box.Text);
            f.Close();
        }
        public void ProgrammaticallyChangeTextIsNotRecorded()
        {
            Form form = new TextBoxTestForm();
            form.Show();
            TestWriter writer = new TestWriter(form);
            Assert.Equal("", writer.Test);

            TextBoxTester textBox = new TextBoxTester("myTextBox", form);
            textBox.Properties.Text = "abc";

            Assert.Equal(@"", writer.Test);
        }
        public void ProgrammaticallyChangeTextIsNotRecordedTwoBoxes()
        {
            Form form = new TextBoxTestForm();
            form.Show();
            TestWriter writer = new TestWriter(form);
            Assert.Equal("", 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.Equal(@"", writer.Test);
        }
        public void TextBox()
        {
            Form form = new TextBoxTestForm();

            form.Show();

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

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

            Keyboard.UseOn(box);

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

            Assert.Equal("abCC", box.Text);
        }
        public void TextBox()
        {
            Form form = new TextBoxTestForm();
            form.Show();

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

            Keyboard.UseOn(box);

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

            Assert.Equal("abCC", box.Text);
        }
        public void TextBoxEnter()
        {
            Form form = new TextBoxTestForm();
            form.Show();
            TestWriter writer = new TestWriter(form);
            Assert.Equal("", writer.Test);

            TextBoxTester textBox = new TextBoxTester("myTextBox", form);
            //doing 2 of these tests the collapsing processor.
            textBox.Enter("abc");
            textBox.Enter("abcd");

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

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

            myTextBox.Enter(""abcd"");

            }",
                writer.Test);
        }
        public void TextBoxEnterMultiline()
        {
            Form form = new TextBoxTestForm();
            form.Show();
            TestWriter writer = new TestWriter(form);
            Assert.Equal("", writer.Test);

            TextBoxTester textBox = new TextBoxTester("myTextBox", form);
            textBox.Properties.Multiline = true;

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

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

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

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

            }",
                writer.Test);
        }
Exemplo n.º 9
0
 public void TextBox()
 {
     TextBoxTestForm f = new TextBoxTestForm();
     f.Show();
     TextBoxTester box = new TextBoxTester("myTextBox");
     Assert.Equal("default", box.Text);
     box.Enter("Text");
     Assert.Equal("Text", box.Text);
     f.Close();
 }