示例#1
0
        /// <summary>Composes the supplied builders.</summary>
        /// <param name="builders">The builders to compose.</param>
        /// <returns>
        /// A new <see cref="ISpecimenBuilderNode" /> instance containing
        /// <paramref name="builders" /> as child nodes.
        /// </returns>
        public override ISpecimenBuilderNode Compose(IEnumerable <ISpecimenBuilder> builders)
        {
            var composedBuilder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);
            var pp = new Postprocessor(composedBuilder, this.Command, this.Specification);

            pp.action = this.action;
            return(pp);
        }
        /// <summary>Composes the supplied builders.</summary>
        /// <param name="builders">The builders to compose.</param>
        /// <returns>
        /// A new <see cref="ISpecimenBuilderNode" /> instance containing
        /// <paramref name="builders" /> as child nodes.
        /// </returns>
        public override ISpecimenBuilderNode Compose(
            IEnumerable <ISpecimenBuilder> builders)
        {
            var composedBuilder =
                CompositeSpecimenBuilder.ComposeIfMultiple(builders);

            return(new OmitOnRecursionGuard(composedBuilder, this.Comparer));
        }
示例#3
0
        /// <summary>Composes the supplied builders.</summary>
        /// <param name="builders">The builders to compose.</param>
        /// <returns>
        /// A new <see cref="ISpecimenBuilderNode" /> instance containing
        /// <paramref name="builders" /> as child nodes.
        /// </returns>
        public virtual ISpecimenBuilderNode Compose(IEnumerable <ISpecimenBuilder> builders)
        {
            var composedBuilder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);
            var d = new DisposableTracker(composedBuilder);

            this.disposables.Add(d);
            return(d);
        }
示例#4
0
        /// <summary>Composes the supplied builders.</summary>
        /// <param name="builders">The builders to compose.</param>
        /// <returns>
        /// A new <see cref="ISpecimenBuilderNode" /> instance containing
        /// <paramref name="builders" /> as child nodes.
        /// </returns>
        public virtual ISpecimenBuilderNode Compose(IEnumerable <ISpecimenBuilder> builders)
        {
            var builder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);

            return(new TraceWriter(
                       this.writer,
                       new TracingBuilder(
                           builder)));
        }
示例#5
0
        /// <summary>Composes the supplied builders.</summary>
        /// <param name="builders">The builders to compose.</param>
        /// <returns>A <see cref="ISpecimenBuilderNode" /> instance.</returns>
        /// <remarks>
        /// <para>
        /// Note to implementers:
        /// </para>
        /// <para>
        /// The intent of this method is to compose the supplied
        /// <paramref name="builders" /> into a new instance of the type
        /// implementing <see cref="ISpecimenBuilderNode" />. Thus, the
        /// concrete return type is expected to the same type as the type
        /// implementing the method. However, it is not considered a failure to
        /// deviate from this idiom - it would just not be a mainstream
        /// implementation.
        /// </para>
        /// <para>
        /// The returned instance is normally expected to contain the builders
        /// supplied as an argument, but again this is not strictly required.
        /// The implementation may decide to filter the sequence or add to it
        /// during composition.
        /// </para>
        /// </remarks>
        public virtual ISpecimenBuilderNode Compose(
            IEnumerable <ISpecimenBuilder> builders)
        {
            var composedBuilder = CompositeSpecimenBuilder.ComposeIfMultiple(
                builders);

            return(new RecursionGuard(
                       composedBuilder,
                       this.recursionHandler,
                       this.comparer));
        }
        /// <summary>Composes the supplied builders.</summary>
        /// <param name="builders">The builders to compose.</param>
        /// <returns>
        /// A new <see cref="ISpecimenBuilderNode" /> instance containing
        /// <paramref name="builders" /> as child nodes.
        /// </returns>
        public ISpecimenBuilderNode Compose(IEnumerable <ISpecimenBuilder> builders)
        {
            var composedBuilder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);

            return(new NoSpecimenOutputGuard(composedBuilder, this.specification));
        }
示例#7
0
        /// <summary>Composes the supplied builders.</summary>
        /// <param name="builders">The builders to compose.</param>
        /// <returns>
        /// A new <see cref="ISpecimenBuilderNode" /> instance containing
        /// <paramref name="builders" /> as child nodes.
        /// </returns>
        public virtual ISpecimenBuilderNode Compose(IEnumerable <ISpecimenBuilder> builders)
        {
            var composedBuilder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);

            return(new FilteringSpecimenBuilder(composedBuilder, this.specification));
        }
        /// <summary>Composes the supplied builders.</summary>
        /// <param name="builders">The builders to compose.</param>
        /// <returns>
        /// A new <see cref="ISpecimenBuilderNode" /> instance containing
        /// <paramref name="builders" /> as child nodes.
        /// </returns>
        public virtual ISpecimenBuilderNode Compose(IEnumerable <ISpecimenBuilder> builders)
        {
            var builder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);

            return(new TerminatingWithPathSpecimenBuilder(new TracingBuilder(builder)));
        }