public void ComposeReturnsCorrectResult()
        {
            // Fixture setup
            var builder1 = new DelegatingSpecimenBuilder();
            var builder2 = new DelegatingSpecimenBuilder();
            var builder3 = new DelegatingSpecimenBuilder();

            var composer = new DelegatingComposer <object> {
                OnCompose = () => builder1
            };
            var behaviors = new[]
            {
                new DelegatingSpecimenBuilderTransformation {
                    OnTransform = b => b == builder1 ? builder2 : new DelegatingSpecimenBuilder()
                },
                new DelegatingSpecimenBuilderTransformation {
                    OnTransform = b => b == builder2 ? builder3 : new DelegatingSpecimenBuilder()
                }
            };

            var sut = new BehaviorComposer <object>(composer, behaviors);
            // Exercise system
            var result = sut.Compose();

            // Verify outcome
            Assert.Equal(builder3, result);
            // Teardown
        }
        public void ComposeWithNoBehaviorsReturnsCorrectResult()
        {
            // Fixture setup
            var expectedBuilder = new DelegatingSpecimenBuilder();
            var composer        = new DelegatingComposer <object> {
                OnCompose = () => expectedBuilder
            };
            var sut = new BehaviorComposer <object>(composer);
            // Exercise system
            var result = sut.Compose();

            // Verify outcome
            Assert.Equal(expectedBuilder, result);
            // Teardown
        }
 public void ComposeWithNoBehaviorsReturnsCorrectResult()
 {
     // Fixture setup
     var expectedBuilder = new DelegatingSpecimenBuilder();
     var composer = new DelegatingComposer<object> { OnCompose = () => expectedBuilder };
     var sut = new BehaviorComposer<object>(composer);
     // Exercise system
     var result = sut.Compose();
     // Verify outcome
     Assert.Equal(expectedBuilder, result);
     // Teardown
 }
        public void ComposeReturnsCorrectResult()
        {
            // Fixture setup
            var builder1 = new DelegatingSpecimenBuilder();
            var builder2 = new DelegatingSpecimenBuilder();
            var builder3 = new DelegatingSpecimenBuilder();

            var composer = new DelegatingComposer<object> { OnCompose = () => builder1 };
            var behaviors = new[]
                {
                    new DelegatingSpecimenBuilderTransformation { OnTransform = b => b == builder1 ? builder2 : new DelegatingSpecimenBuilder() },
                    new DelegatingSpecimenBuilderTransformation { OnTransform = b => b == builder2 ? builder3 : new DelegatingSpecimenBuilder() }
                };

            var sut = new BehaviorComposer<object>(composer, behaviors);
            // Exercise system
            var result = sut.Compose();
            // Verify outcome
            Assert.Equal(builder3, result);
            // Teardown
        }