예제 #1
0
		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());
		}
예제 #2
0
        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());
        }
예제 #3
0
        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());
        }
예제 #4
0
		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());

		}