示例#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);
        }
        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);
        }