Exemplo n.º 1
0
        public void EntityCompareIdSuccess()
        {
            // Arrange
            var dummy1 = new DummyEntity(1);
            var dummy2 = new DummyEntity(1);

            // Act
            // Assert
            Assert.IsTrue(dummy1.Equals(dummy2));
            Assert.IsTrue(dummy1.GetHashCode() == dummy2.GetHashCode());
        }
Exemplo n.º 2
0
        public void EntityCompareIdFail()
        {
            // Arrange
            var dummy1 = new DummyEntity(1);
            var dummy2 = new DummyEntity(2);

            // Act
            // Assert
            Assert.IsFalse(dummy1.Equals(dummy2 as object));
            Assert.IsTrue(dummy1.GetHashCode() != dummy2.GetHashCode());
            Assert.IsFalse(dummy1.Equals(null));
        }