Example #1
0
        public void GivenBothPagesAreNull_WhenCompare_ThenTrue()
        {
            //Arrange
            var  comparer = new PageComparer();
            Page a        = null;
            Page b        = null;

            //Act/Assert
            Assert.IsTrue(comparer.Equals(a, b));
        }
Example #2
0
        public void GivenSamePageObject_WhenCompare_ThenTrue()
        {
            //Arrange
            var mock = new Mock <IHtmlProvider>();

            mock.Setup(m => m.Url).Returns("Object A Url");
            var  comparer = new PageComparer();
            Page a        = new Page(mock.Object, null);

            //Act/Assert
            Assert.IsTrue(comparer.Equals(a, a));
        }
Example #3
0
        public void GivenBPagesIsNull_WhenCompare_ThenFalse()
        {
            //Arrange
            var mock = new Mock <IHtmlProvider>();

            mock.Setup(m => m.Url).Returns("Object A Url");
            var  comparer = new PageComparer();
            Page a        = new Page(mock.Object, null);
            Page b        = null;

            //Act/Assert
            Assert.IsFalse(comparer.Equals(a, b));
        }
Example #4
0
        public void GivenSamePage_WhenCompare_ThenTrue()
        {
            //Arrange
            var mockA = new Mock <IHtmlProvider>();

            mockA.Setup(m => m.Url).Returns("google.com");

            var mockB = new Mock <IHtmlProvider>();

            mockB.Setup(m => m.Url).Returns("google.com");

            var  comparer = new PageComparer();
            Page a        = new Page(mockA.Object, null);
            Page b        = new Page(mockB.Object, null);

            //Act/Assert
            Assert.IsTrue(comparer.Equals(a, b));
        }