Example #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);

            return(new OmitOnRecursionGuard(composedBuilder, this.Comparer));
        }
Example #2
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);
        }
        /// <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)
        {
            if (builders == null)
            {
                throw new ArgumentNullException(nameof(builders));
            }

            return(new TerminatingWithPathSpecimenBuilder(CompositeSpecimenBuilder.ComposeIfMultiple(builders)));
        }
Example #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 override ISpecimenBuilderNode Compose(IEnumerable <ISpecimenBuilder> builders)
        {
            var composedBuilder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);
            var pp = new Postprocessor(composedBuilder, this.Command, this.Specification);

#pragma warning disable 618
            ObsoletedMemberShims.Postprocessor_SetAction(pp, ObsoletedMemberShims.Postprocessor_GetAction(this));
#pragma warning restore 618
            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)
        {
            if (builders == null)
            {
                throw new ArgumentNullException(nameof(builders));
            }

            var builder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);

            return(new ThrowingRecursionGuard(builder, 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 virtual ISpecimenBuilderNode Compose(IEnumerable <ISpecimenBuilder> builders)
        {
            if (builders == null)
            {
                throw new ArgumentNullException(nameof(builders));
            }

            var composedBuilder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);

            return(new FilteringSpecimenBuilder(composedBuilder, this.Specification));
        }
Example #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 ISpecimenBuilderNode Compose(IEnumerable <ISpecimenBuilder> builders)
        {
            if (builders == null)
            {
                throw new ArgumentNullException(nameof(builders));
            }

            var composedBuilder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);

            return(new NoSpecimenOutputGuard(composedBuilder, this.Specification));
        }
Example #8
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,
                       this.RecursionDepth));
        }
Example #9
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)
        {
            if (builders == null)
            {
                throw new ArgumentNullException(nameof(builders));
            }

            var composedBuilder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);
            var d = new DisposableTracker(composedBuilder);

            this.disposables.Add(d);
            return(d);
        }
Example #10
0
        /// <inheritdoc />
        public virtual ISpecimenBuilderNode Compose(IEnumerable <ISpecimenBuilder> builders)
        {
            if (builders == null)
            {
                throw new ArgumentNullException(nameof(builders));
            }

            var composedBuilder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);

            return(new RecursionGuard(
                       composedBuilder,
                       this.RecursionHandler,
                       this.Comparer,
                       this.RecursionDepth));
        }
        /// <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));
        }
Example #12
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 ISpecimenBuilderNode Compose(IEnumerable <ISpecimenBuilder> builders)
        {
            var composedBuilder = CompositeSpecimenBuilder.ComposeIfMultiple(builders);

            return(new NoSpecimenOutputGuard(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)
 {
     return(new TerminatingWithPathSpecimenBuilder(CompositeSpecimenBuilder.ComposeIfMultiple(builders)));
 }