public void CollectionCompareFalseComparison() { AnEntityWithCollection e1 = new AnEntityWithCollection() { Id = 1, Collection = { "a", "b" } }; AnEntityWithCollection e2 = new AnEntityWithCollection() { Id = 1, Collection = { "a", "c" } }; Assert.That(ObjectComparer.AreEqual(e1, e2), Is.False); }
public void CollectionCompareDifferentNumberOfElement2() { AnEntityWithCollection e1 = new AnEntityWithCollection() { Id = 1, Collection = { "a", "b", "c" } }; AnEntityWithCollection e2 = new AnEntityWithCollection() { Id = 1, Collection = { "a", "b" } }; Assert.That(ObjectComparer.AreEqual(e1, e2), Is.False); }
public void VerifyMessageOfCollectionCompareFalseComparison() { AnEntityWithCollection e1 = new AnEntityWithCollection() { Id = 1, Collection = { "a", "b" } }; AnEntityWithCollection e2 = new AnEntityWithCollection() { Id = 1, Collection = { "a", "c" } }; ObjectComparer comparer = new ObjectComparer(); var res = comparer.FindDifferencies(e1, e2); Assert.That(res[0], Text.Contains("b!=c")); Assert.That(res[0], Text.Contains("root.Collection")); }