public void ShouldCallBaseForToString() { Mock<IWebElement> mockElement = new Mock<IWebElement>(); IHoverAndClickControlBean bean = new HoverAndClickControlBean(); bean.ContentContainer = mockElement.Object; Assert.AreEqual("HoverAndClickControlBean(ClickControlBean(ContentContainerBean(LoadableBean(Driver: " + "null, LoadTimeout: 30), ContentContainer: " + mockElement.Object.ToString() + "), " + "ClickWithJavascript: False), UnhoverElement: null, HoverWithJavascript: False, " + "UnhoverWithJavascript: False, ClickWithJavascriptInsteadOfHover: False, UnhoverWithClickInstead: " + "False, UnhoverWithJavascriptClickInstead: False, PollingTimeout: 30, PollingInterval: 1)", bean.ToString()); }
public void ShouldCallBaseForHashCode() { IHoverAndClickControlBean bean = new HoverAndClickControlBean(); IHoverAndClickControlBean beanToCompare = new HoverAndClickControlBean(); Assert.AreEqual(bean.GetHashCode(), beanToCompare.GetHashCode(), "Hash codes for bean which have not had " + "setters called should be equal, but are not: " + bean.ToString() + ", " + beanToCompare.ToString()); bean.ClickWithJavascript = true; Assert.AreNotEqual(bean.GetHashCode(), beanToCompare.GetHashCode(), "Hash codes for bean which have " + "different values for their Javascript click workaround fields should not be equal, but are: " + bean.ToString() + ", " + beanToCompare.ToString()); beanToCompare.ClickWithJavascript = true; Assert.AreEqual(bean.GetHashCode(), beanToCompare.GetHashCode(), "Hash codes for bean which have the " + "same Javascript click workaround value should be equal, but are not: " + bean.ToString() + ", " + beanToCompare.ToString()); }