public void ObjectsWithEmptyIDsAreNotEqualUsingEqualsMethod() { // Arrange. var post1 = new BlogPost(); var post2 = new BlogPost(); // Act / Assert. Assert.That(post1.Equals(post2), Is.False); }
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); }