Exemplo n.º 1
0
        public void CompareTheSameReferenceReturnTrueTest()
        {
            //Arrange
            TestEntity entityLeft = new TestEntity();
            TestEntity entityRight = entityLeft;


            //Act
            if (! entityLeft.Equals(entityRight))
                Assert.Fail();

            if (!(entityLeft == entityRight))
                Assert.Fail();

        }
Exemplo n.º 2
0
        public void DiferentIdProduceEqualsFalseTest()
        {
            //Arrange
            
            TestEntity entityLeft = new TestEntity();
            TestEntity entityRight = new TestEntity();

            entityLeft.Id = IdentityGenerator.SequentialGuid(); ;
            entityRight.Id = IdentityGenerator.SequentialGuid(); ;

            //Act
            bool resultOnEquals = entityLeft.Equals(entityRight);
            bool resultOnOperator = entityLeft == entityRight;

            //Assert
            Assert.IsFalse(resultOnEquals);
            Assert.IsFalse(resultOnOperator);

        }