public void ShouldCallBaseForToString() { Mock<IWebElement> mockElement = new Mock<IWebElement>(); IControllableBean bean = new ControllableBean(); bean.ContentContainer = mockElement.Object; Assert.AreEqual("ControllableBean(ContentContainerBean(LoadableBean(Driver: null, LoadTimeout: 30), " + "ContentContainer: " + mockElement.Object.ToString() + "), Control Beans: " + "System.Collections.Generic.Dictionary`2[System.String,Org.Brixen.Bean.IControlBean])", bean.ToString()); }
public void ShouldCallBaseForHashCode() { IControllableBean bean = new ControllableBean(); IControllableBean beanToCompare = new ControllableBean(); 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()); }