public void ShouldCallBaseForToString() { Mock<IWebElement> mockElement = new Mock<IWebElement>(); IClickableBean bean = new ClickableBean(); bean.ContentContainer = mockElement.Object; Assert.AreEqual("ClickableBean(ContentContainerBean(LoadableBean(Driver: null, LoadTimeout: 30), " + "ContentContainer: " + mockElement.Object.ToString() + "), ClickWithJavascript: False)", bean.ToString()); }
public void ShouldCallBaseForHashCode() { IClickableBean bean = new ClickableBean(); IClickableBean beanToCompare = new ClickableBean(); 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()); Mock <IWebElement> mockElement = new Mock <IWebElement>(); bean.ContentContainer = mockElement.Object; Assert.AreNotEqual(bean.GetHashCode(), beanToCompare.GetHashCode(), "Hash codes for bean which have " + "different values for their container element fields should not be equal, but are: " + bean.ToString() + ", " + beanToCompare.ToString()); beanToCompare.ContentContainer = mockElement.Object; Assert.AreEqual(bean.GetHashCode(), beanToCompare.GetHashCode(), "Hash codes for bean which have the " + "same container element should be equal, but are not: " + bean.ToString() + ", " + beanToCompare.ToString()); }
public void ShouldCallBaseForToString() { Mock <IWebElement> mockElement = new Mock <IWebElement>(); IClickableBean bean = new ClickableBean(); bean.ContentContainer = mockElement.Object; Assert.AreEqual("ClickableBean(ContentContainerBean(LoadableBean(Driver: null, LoadTimeout: 30), " + "ContentContainer: " + mockElement.Object.ToString() + "), ClickWithJavascript: False)", bean.ToString()); }
public void ShouldCallBaseForHashCode() { IClickableBean bean = new ClickableBean(); IClickableBean beanToCompare = new ClickableBean(); 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()); Mock<IWebElement> mockElement = new Mock<IWebElement>(); bean.ContentContainer = mockElement.Object; Assert.AreNotEqual(bean.GetHashCode(), beanToCompare.GetHashCode(), "Hash codes for bean which have " + "different values for their container element fields should not be equal, but are: " + bean.ToString() + ", " + beanToCompare.ToString()); beanToCompare.ContentContainer = mockElement.Object; Assert.AreEqual(bean.GetHashCode(), beanToCompare.GetHashCode(), "Hash codes for bean which have the " + "same container element should be equal, but are not: " + bean.ToString() + ", " + beanToCompare.ToString()); }