Exemple #1
0
        public void SelectOption()
        {
            RadioButtonTester rbRed            = new RadioButtonTester("rbRed");
            LabelTester       lblSelectedColor = new LabelTester("lblSelectedColor");
            RadioButtonTester rbOrange         = new RadioButtonTester("rbOrange");
            RadioButtonTester rbGreen          = new RadioButtonTester("rbGreen");
            RadioButtonTester rbYellow         = new RadioButtonTester("rbYellow");
            RadioButtonTester rbBlue           = new RadioButtonTester("rbBlue");
            RadioButtonTester rbIndigo         = new RadioButtonTester("rbIndigo");
            RadioButtonTester rbViolet         = new RadioButtonTester("rbViolet");

            rbRed.Click();
            Assert.AreEqual("Red", lblSelectedColor.Properties.Text);
            Assert.AreEqual(true, rbRed.Properties.Checked);
            Assert.AreEqual(false, rbOrange.Properties.Checked);
            Assert.AreEqual("Red", rbRed.Text);
            Assert.AreEqual("Red", rbRed.Properties.Text);

            rbOrange.Click();
            Assert.AreEqual("Orange", lblSelectedColor.Properties.Text);
            Assert.AreEqual(false, rbRed.Properties.Checked);
            Assert.AreEqual(true, rbOrange.Properties.Checked);
            Assert.AreEqual("Orange", rbOrange.Text);
            Assert.AreEqual("Orange", rbOrange.Properties.Text);
        }
        public void Click()
        {
            RadioButtonTestForm form = new RadioButtonTestForm();

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

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

            RadioButtonTester red    = new RadioButtonTester("rbRed", form);
            RadioButtonTester orange = new RadioButtonTester("rbOrange", form);

            red.Click();
            orange.Click();

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

	RadioButtonTester rbRed = new RadioButtonTester(""rbRed"");
	RadioButtonTester rbOrange = new RadioButtonTester(""rbOrange"");

	rbRed.Click();
	rbOrange.Click();

}",
                writer.Test);
        }
        public void SelectOption()
        {
            RadioButtonTester rbRed = new RadioButtonTester("rbRed");
            LabelTester lblSelectedColor = new LabelTester("lblSelectedColor");
            RadioButtonTester rbOrange = new RadioButtonTester("rbOrange");
            RadioButtonTester rbGreen = new RadioButtonTester("rbGreen");
            RadioButtonTester rbYellow = new RadioButtonTester("rbYellow");
            RadioButtonTester rbBlue = new RadioButtonTester("rbBlue");
            RadioButtonTester rbIndigo = new RadioButtonTester("rbIndigo");
            RadioButtonTester rbViolet = new RadioButtonTester("rbViolet");

            rbRed.Click();
            Assert.AreEqual("Red", lblSelectedColor.Properties.Text);
            Assert.AreEqual(true, rbRed.Properties.Checked);
            Assert.AreEqual(false, rbOrange.Properties.Checked);
            Assert.AreEqual("Red", rbRed.Text);
            Assert.AreEqual("Red", rbRed.Properties.Text);

            rbOrange.Click();
            Assert.AreEqual("Orange", lblSelectedColor.Properties.Text);
            Assert.AreEqual(false, rbRed.Properties.Checked);
            Assert.AreEqual(true, rbOrange.Properties.Checked);
            Assert.AreEqual("Orange", rbOrange.Text);
            Assert.AreEqual("Orange", rbOrange.Properties.Text);
        }
        public void Click()
        {
            RadioButtonTestForm form = new RadioButtonTestForm();
            form.Show();
            TestWriter writer = new TestWriter(form);
            Assert.Equal("", writer.Test);

            RadioButtonTester red = new RadioButtonTester("rbRed", form);
            RadioButtonTester orange = new RadioButtonTester("rbOrange", form);
            red.Click();
            orange.Click();

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

            RadioButtonTester rbRed = new RadioButtonTester(""rbRed"");
            RadioButtonTester rbOrange = new RadioButtonTester(""rbOrange"");

            rbRed.Click();
            rbOrange.Click();

            }",
                writer.Test);
        }
        public void Test_EnterDataAndApply()
        {
            Assert.IsNotNull(fDialog.Filter);

            var rbCutPersons = new RadioButtonTester("rbCutPersons", fDialog);

            rbCutPersons.Click();

            var rbCutYears = new RadioButtonTester("rbCutYears", fDialog);

            rbCutYears.Click();

            var rbCutNone = new RadioButtonTester("rbCutNone", fDialog);

            rbCutNone.Click();

            ClickButton("btnAccept", fDialog);
        }
        public static void ClickRadioButton(string name, Form form)
        {
            var radBtn = new RadioButtonTester(name, form);

            radBtn.Click();
        }