public void ShouldBeEqual()
        {
            ILoadableBean beanOne = new LoadableBean();
            ILoadableBean beanTwo = new LoadableBean();

            Assert.AreEqual(beanOne, beanTwo, "Two newly constructed beans should be equal before any setters are " +
                "invoked");

            Mock<IWebDriver> mockDriver = new Mock<IWebDriver>();

            beanOne.Driver = mockDriver.Object;
            beanTwo.Driver = mockDriver.Object;

            Assert.AreEqual(beanOne, beanTwo, "Two beans should be equal if they have the same web driver reference " +
                "and the default load timeout");

            beanOne.LoadTimeout = 40;
            beanTwo.LoadTimeout = 40;

            Assert.AreEqual(beanOne, beanTwo, "Two beans should be equal if they have the same web driver reference " +
                "and the same non-default load timeout");

            beanOne = new LoadableBean();
            beanTwo = new LoadableBean();

            beanOne.LoadTimeout = 40;
            beanTwo.LoadTimeout = 40;

            Assert.AreEqual(beanOne, beanTwo, "Two beans should be equal if they have null web driver reference " +
                "and the same non-default load timeout");
        }
예제 #2
0
		public void ShouldNotBeEqual() {
			Mock<IWebDriver> mockDriverOne = new Mock<IWebDriver>();
			Mock<IWebDriver> mockDriverTwo = new Mock<IWebDriver>();

			ILoadableBean beanOne = new LoadableBean();
			ILoadableBean beanTwo = new LoadableBean();

			beanOne.Driver = mockDriverOne.Object;
			beanTwo.Driver = mockDriverTwo.Object;

			Assert.AreNotEqual(beanOne, beanTwo, "Beans with different driver references should not be equal");

			beanOne = new LoadableBean();
			beanTwo = new LoadableBean();

			beanOne.LoadTimeout = 40;

			Assert.AreNotEqual(beanOne, beanTwo, "Beans with different load timeouts should not be equal");
		}
 public void ShouldThrowExceptionForNullDriver()
 {
     ILoadableBean bean = new LoadableBean();
     bean.Driver = null;
 }
 public void ShouldThrowExceptionForNegativeLoadTimeout()
 {
     ILoadableBean bean = new LoadableBean();
     bean.LoadTimeout = -1;
 }