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); }
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); }