public void FromSeedReturnsCorrectResult()
        {
            // Arrange
            var node = new CompositeSpecimenBuilder(
                new DelegatingSpecimenBuilder(),
                SpecimenBuilderNodeFactory.CreateComposer <int>(),
                SpecimenBuilderNodeFactory.CreateComposer <string>(),
                SpecimenBuilderNodeFactory.CreateComposer <int>(),
                new DelegatingSpecimenBuilder());
            var             sut = new CompositeNodeComposer <int>(node);
            Func <int, int> f   = i => i;
            // Act
            var actual = sut.FromSeed(f);
            // Assert
            var expected = new CompositeNodeComposer <int>(
                new CompositeSpecimenBuilder(
                    new DelegatingSpecimenBuilder(),
                    (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer <int>().FromSeed(f),
                    SpecimenBuilderNodeFactory.CreateComposer <string>(),
                    (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer <int>().FromSeed(f),
                    new DelegatingSpecimenBuilder()));
            var n = Assert.IsAssignableFrom <ISpecimenBuilderNode>(actual);

            Assert.True(expected.GraphEquals(n, new NodeComparer()));
        }
        public void FromSeedReturnsCorrectResult()
        {
            // Fixture setup
            var node = new CompositeSpecimenBuilder(
                new DelegatingSpecimenBuilder(),
                SpecimenBuilderNodeFactory.CreateComposer <int>(),
                SpecimenBuilderNodeFactory.CreateComposer <string>(),
                SpecimenBuilderNodeFactory.CreateComposer <int>(),
                new DelegatingSpecimenBuilder());
            var             sut = new CompositeNodeComposer <int>(node);
            Func <int, int> f   = i => i;
            // Exercise system
            var actual = sut.FromSeed(f);
            // Verify outcome
            var expected = new CompositeNodeComposer <int>(
                new CompositeSpecimenBuilder(
                    new DelegatingSpecimenBuilder(),
                    (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer <int>().FromSeed(f),
                    SpecimenBuilderNodeFactory.CreateComposer <string>(),
                    (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer <int>().FromSeed(f),
                    new DelegatingSpecimenBuilder()));
            var n = Assert.IsAssignableFrom <ISpecimenBuilderNode>(actual);

            Assert.True(expected.GraphEquals(n, new NodeComparer()));
            // Teardown
        }
 public void FromSeedReturnsCorrectResult()
 {
     // Fixture setup
     var node = new CompositeSpecimenBuilder(
         new DelegatingSpecimenBuilder(),
         SpecimenBuilderNodeFactory.CreateComposer<int>(),
         SpecimenBuilderNodeFactory.CreateComposer<string>(),
         SpecimenBuilderNodeFactory.CreateComposer<int>(),
         new DelegatingSpecimenBuilder());
     var sut = new CompositeNodeComposer<int>(node);
     Func<int, int> f = i => i;
     // Exercise system
     var actual = sut.FromSeed(f);
     // Verify outcome
     var expected = new CompositeNodeComposer<int>(
         new CompositeSpecimenBuilder(
             new DelegatingSpecimenBuilder(),
             (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer<int>().FromSeed(f),
             SpecimenBuilderNodeFactory.CreateComposer<string>(),
             (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer<int>().FromSeed(f),
             new DelegatingSpecimenBuilder()));
     var n = Assert.IsAssignableFrom<ISpecimenBuilderNode>(actual);
     Assert.True(expected.GraphEquals(n, new NodeComparer()));
     // Teardown
 }