示例#1
0
        public void InjectBrowser()
        {
            var fieldInfo = typeof(Sample).GetField("Browser");
            var info      = new ValueConstructionInfo(fieldInfo.FieldType, new[] { pageObjectElement }, browser);
            var value     = WebElementGetExtensions.CreateFieldValue(fieldInfo, info);

            Assert.AreEqual(browser, value);
        }
示例#2
0
        public void InjectPageObject()
        {
            var fieldInfo = typeof(Sample).GetField("Control");
            var info      = new ValueConstructionInfo(fieldInfo.FieldType, new[] { pageObjectElement }, browser);
            var value     = (PageObject)WebElementGetExtensions.CreateFieldValue(fieldInfo, info);

            Assert.AreEqual(browser, value.Browser);
            Assert.AreEqual(controlElement, value.Element);
        }