Exemplo n.º 1
0
        public void ShouldCallBaseForHashCode()
        {
            IHoverControlBean bean          = new HoverControlBean();
            IHoverControlBean beanToCompare = new HoverControlBean();

            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());
        }
Exemplo n.º 2
0
        public void ShouldCallBaseForToString()
        {
            Mock <IWebElement> mockElement = new Mock <IWebElement>();

            IHoverControlBean bean = new HoverControlBean();

            bean.ContentContainer = mockElement.Object;

            Assert.AreEqual("HoverControlBean(ContentContainerBean(LoadableBean(Driver: null, LoadTimeout: 30), " +
                            "ContentContainer: " + mockElement.Object.ToString() + "), UnhoverElement: null, " +
                            "HoverWithJavascript: False, UnhoverWithJavascript: False, ClickInsteadOfHover: False, " +
                            "ClickWithJavascriptInsteadOfHover: False, UnhoverWithClickInstead: False, " +
                            "UnhoverWithJavascriptClickInstead: False)", bean.ToString());
        }
Exemplo n.º 3
0
		public void ShouldCallBaseForHashCode() {
			IHoverControlBean bean = new HoverControlBean();
			IHoverControlBean beanToCompare = new HoverControlBean();

			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());
		}
Exemplo n.º 4
0
		public void ShouldCallBaseForToString() {
			Mock<IWebElement> mockElement = new Mock<IWebElement>();

			IHoverControlBean bean = new HoverControlBean();
			bean.ContentContainer = mockElement.Object;

			Assert.AreEqual("HoverControlBean(ContentContainerBean(LoadableBean(Driver: null, LoadTimeout: 30), " + 
				"ContentContainer: " + mockElement.Object.ToString() + "), UnhoverElement: null, " + 
				"HoverWithJavascript: False, UnhoverWithJavascript: False, ClickInsteadOfHover: False, " + 
				"ClickWithJavascriptInsteadOfHover: False, UnhoverWithClickInstead: False, " + 
				"UnhoverWithJavascriptClickInstead: False)", bean.ToString());
		}