public void FindElementByXPath_callSeleniumElementFactoryWithXPathLocator() { _seleniumBrowser.FindElementByXPath("testElement"); _autoMoqer.GetMock <ISeleniumElementFactory>() .Verify( v => v.Create(It.IsAny <IWebDriver>(), It.Is <By>(b => b.ToString() == "By.XPath: testElement"), It.IsAny <SeleniumBrowser>())); }