コード例 #1
0
        public void GraphEqualsNullSecondThrows()
        {
            var dummyNode = new CompositeSpecimenBuilder();

            Assert.Throws <ArgumentNullException>(() =>
                                                  dummyNode.GraphEquals(null));
        }
コード例 #2
0
        public void GraphEqualsWithNullEqualityComparerThrows()
        {
            var dummyNode1 = new CompositeSpecimenBuilder();
            var dummyNode2 = new CompositeSpecimenBuilder();

            Assert.Throws <ArgumentNullException>(() =>
                                                  dummyNode1.GraphEquals(dummyNode2, null));
        }
コード例 #3
0
        public void GraphEqualsNullSecondWithEqualityComparerThrows()
        {
            var dummyNode             = new CompositeSpecimenBuilder();
            var dummyEqualityComparer = new DelegatingEqualityComparer <ISpecimenBuilder>();

            Assert.Throws <ArgumentNullException>(() =>
                                                  dummyNode.GraphEquals(null, dummyEqualityComparer));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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
        }