public void EntitiesMustBeEqual_When_AllKeysAreEqual_DespiteOtherValues() { var keyProperties = GetKeyPropertiesMock(); var entity1 = new FakeClass { Id = 1, DoubleValue = 7.11, Value = "Hey Ho, Let's go!" }; var entity2 = new FakeClass { Id = 1, DoubleValue = 7.11, Value = "Seven Eleven" }; var result = comparer.CompareEntities(entity1, entity2, keyProperties); Assert.AreEqual(true, result); }
public void EntitiesMustBeNotEqual_When_KeysNotEqual_DespiteOtherValues() { var keyProperties = GetKeyPropertiesMock(); var entity1 = new FakeClass { Id = 1, DoubleValue = 7.11, Value = "Seven Eleven" }; var entity2 = new FakeClass { Id = 2, DoubleValue = 7.11, Value = "Seven Eleven" }; var result = comparer.CompareEntities(entity1, entity2, keyProperties); Assert.AreEqual(false, result, "Two entities with same values but different key property values are supposed to be not equal"); }