public void DoReturnsCorrectResult()
        {
            // Arrange
            var node = new CompositeSpecimenBuilder(
                new DelegatingSpecimenBuilder(),
                SpecimenBuilderNodeFactory.CreateComposer <ConcreteType>(),
                SpecimenBuilderNodeFactory.CreateComposer <bool>(),
                SpecimenBuilderNodeFactory.CreateComposer <ConcreteType>(),
                new DelegatingSpecimenBuilder());
            var sut = new CompositeNodeComposer <ConcreteType>(node);
            Action <ConcreteType> a =
                ads => ads.Property1 = null;
            // Act
            var actual = sut.Do(a);
            // Assert
            var expected = new CompositeNodeComposer <ConcreteType>(
                new CompositeSpecimenBuilder(
                    new DelegatingSpecimenBuilder(),
                    (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer <ConcreteType>().Do(a),
                    SpecimenBuilderNodeFactory.CreateComposer <bool>(),
                    (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer <ConcreteType>().Do(a),
                    new DelegatingSpecimenBuilder()));
            var n = Assert.IsAssignableFrom <ISpecimenBuilderNode>(actual);

            Assert.True(expected.GraphEquals(n, new NodeComparer()));
        }
        public void DoReturnsCorrectResult()
        {
            // Fixture setup
            var node = new CompositeSpecimenBuilder(
                new DelegatingSpecimenBuilder(),
                SpecimenBuilderNodeFactory.CreateComposer <AppDomainSetup>(),
                SpecimenBuilderNodeFactory.CreateComposer <bool>(),
                SpecimenBuilderNodeFactory.CreateComposer <AppDomainSetup>(),
                new DelegatingSpecimenBuilder());
            var sut = new CompositeNodeComposer <AppDomainSetup>(node);
            Action <AppDomainSetup> a =
                ads => ads.DisallowApplicationBaseProbing = false;
            // Exercise system
            var actual = sut.Do(a);
            // Verify outcome
            var expected = new CompositeNodeComposer <AppDomainSetup>(
                new CompositeSpecimenBuilder(
                    new DelegatingSpecimenBuilder(),
                    (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer <AppDomainSetup>().Do(a),
                    SpecimenBuilderNodeFactory.CreateComposer <bool>(),
                    (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer <AppDomainSetup>().Do(a),
                    new DelegatingSpecimenBuilder()));
            var n = Assert.IsAssignableFrom <ISpecimenBuilderNode>(actual);

            Assert.True(expected.GraphEquals(n, new NodeComparer()));
            // Teardown
        }
 public void DoReturnsCorrectResult()
 {
     // Fixture setup
     var node = new CompositeSpecimenBuilder(
         new DelegatingSpecimenBuilder(),
         SpecimenBuilderNodeFactory.CreateComposer<AppDomainSetup>(),
         SpecimenBuilderNodeFactory.CreateComposer<bool>(),
         SpecimenBuilderNodeFactory.CreateComposer<AppDomainSetup>(),
         new DelegatingSpecimenBuilder());
     var sut = new CompositeNodeComposer<AppDomainSetup>(node);
     Action<AppDomainSetup> a =
         ads => ads.DisallowApplicationBaseProbing = false;
     // Exercise system
     var actual = sut.Do(a);
     // Verify outcome
     var expected = new CompositeNodeComposer<AppDomainSetup>(
         new CompositeSpecimenBuilder(
             new DelegatingSpecimenBuilder(),
             (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer<AppDomainSetup>().Do(a),
             SpecimenBuilderNodeFactory.CreateComposer<bool>(),
             (ISpecimenBuilder)SpecimenBuilderNodeFactory.CreateComposer<AppDomainSetup>().Do(a),
             new DelegatingSpecimenBuilder()));
     var n = Assert.IsAssignableFrom<ISpecimenBuilderNode>(actual);
     Assert.True(expected.GraphEquals(n, new NodeComparer()));
     // Teardown
 }