Пример #1
0
        public void TestFindByNameUsingRepo()
        {
            var button = new ButtonControl();

            button.SystemUnderTestFromRepo("ok button using button name");
            button.Click();
            Assert.AreEqual("clicked", TextBoxOne.Text);
        }
Пример #2
0
        public void TestFindByRootUsingRepo()
        {
            var button = new ButtonControl();

            button.SystemUnderTestFromRepo("ok button using root automation id");
            button.Click();
            Assert.AreEqual("clicked", TextBoxOne.Text);
        }
Пример #3
0
        public void TestFindByRoot()
        {
            var button = new ButtonControl();

            button.SystemUnderTest(new ControlLocatorDef <FindControl>(
                                       () => new FindByAutomationId("Form1", true),
                                       () => new FindByName("Ok")
                                       ));
            button.Click();
            Assert.AreEqual("clicked", TextBoxOne.Text);
        }
Пример #4
0
        public void Test02_CalcResult()
        {
            var b = new ButtonControl();

            b.SystemUnderTestFromRepo("4");
            b.Click();
            var textBox = new TextBoxControl();

            textBox.SystemUnderTestFromRepo("result");

            Assert.AreEqual("4", textBox.Name);
        }
Пример #5
0
        public void TestFindByName()
        {
            var button = new ButtonControl();

            button.SystemUnderTest(new ControlLocatorDef <FindControl>(
                                       () => new FindWindow("Demo Form"),
                                       () => new FindByName("Ok")
                                       ));
            button.Click();


            Assert.AreEqual("clicked", TextBoxOne.Text);
        }
Пример #6
0
        private static String Invoke(int processId, String method, IntPtr handle)
        {
            var textBox = new TextBoxControl();

            textBox.SystemUnderTest(new ControlLocatorDef <FindControl>(
                                        () => new FindWindow("TestControlRig" + processId),
                                        () => new FindByAutomationId("method")
                                        ));
            textBox.Text = method;
            textBox.SystemUnderTest(new ControlLocatorDef <FindControl>(
                                        () => new FindWindow("TestControlRig" + processId),
                                        () => new FindByAutomationId("handle")
                                        ));
            textBox.Text = handle.ToString();
            var button = new ButtonControl();

            button.SystemUnderTest(new ControlLocatorDef <FindControl>(
                                       () => new FindWindow("TestControlRig" + processId),
                                       () => new FindByAutomationId("call")
                                       ));
            button.Click();
            return(null);
        }