public void GraphEqualsNullSecondThrows() { var dummyNode = new CompositeSpecimenBuilder(); Assert.Throws <ArgumentNullException>(() => dummyNode.GraphEquals(null)); }
public void GraphEqualsWithNullEqualityComparerThrows() { var dummyNode1 = new CompositeSpecimenBuilder(); var dummyNode2 = new CompositeSpecimenBuilder(); Assert.Throws <ArgumentNullException>(() => dummyNode1.GraphEquals(dummyNode2, null)); }
public void GraphEqualsNullSecondWithEqualityComparerThrows() { var dummyNode = new CompositeSpecimenBuilder(); var dummyEqualityComparer = new DelegatingEqualityComparer <ISpecimenBuilder>(); Assert.Throws <ArgumentNullException>(() => dummyNode.GraphEquals(null, dummyEqualityComparer)); }
public void EmptyNodesAreEqualAccordingToComparer(bool expected) { // Arrange var node1 = new CompositeSpecimenBuilder(); var node2 = new CompositeSpecimenBuilder(); var comparer = new DelegatingEqualityComparer <ISpecimenBuilder> { OnEquals = (x, y) => x == node1 && y == node2 && expected }; // Act var actual = node1.GraphEquals(node2, comparer); // Assert Assert.Equal(expected, actual); }
public void EmptyNodesAreEqualAccordingToComparer(bool expected) { // Fixture setup var node1 = new CompositeSpecimenBuilder(); var node2 = new CompositeSpecimenBuilder(); var comparer = new DelegatingEqualityComparer <ISpecimenBuilder> { OnEquals = (x, y) => x == node1 && y == node2 && expected }; // Exercise system var actual = node1.GraphEquals(node2, comparer); // Verify outcome Assert.Equal(expected, actual); // Teardown }