예제 #1
0
        public void ObjectsWithEmptyIDsAreNotEqualUsingEqualsMethod()
        {
            // Arrange.
            var post1 = new BlogPost();
            var post2 = new BlogPost();

            // Act / Assert.
            Assert.That(post1.Equals(post2), Is.False);
        }
예제 #2
0
        public void ObjectsWithSameIDAreEqualUsingEqualsMethod()
        {
            // Arrange.
            var id    = ObjectId.GenerateNewId();
            var post1 = new BlogPost {
                ID = id
            };
            var post2 = new BlogPost {
                ID = id
            };

            // Act / Assert.
            Assert.That(post1.Equals(post2), Is.True);
        }