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