本文整理汇总了C#中ISpecimenBuilder类的典型用法代码示例。如果您正苦于以下问题:C# ISpecimenBuilder类的具体用法?C# ISpecimenBuilder怎么用?C# ISpecimenBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISpecimenBuilder类属于命名空间,在下文中一共展示了ISpecimenBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CustomizationNode
/// <summary>
/// Initializes a new instance of the <see cref="CustomizationNode" />
/// class.
/// </summary>
/// <param name="builder">The builder to decorate.</param>
/// <remarks>
/// <para>
/// After initialization <paramref name="builder" /> is available via
/// the <see cref="Builder" /> property.
/// </para>
/// </remarks>
/// <exception cref="System.ArgumentNullException">
/// <paramref name="builder" /> is null.
/// </exception>
/// <seealso cref="Builder"/>
public CustomizationNode(ISpecimenBuilder builder)
{
if (builder == null)
throw new ArgumentNullException("builder");
this.builder = builder;
}
示例2: AutoPropertiesTarget
/// <summary>
/// Initializes a new instance of the
/// <see cref="AutoPropertiesTarget" /> class.
/// </summary>
/// <param name="builder">The builder to decorate.</param>
/// <remarks>
/// <para>
/// After initialization <paramref name="builder" /> is available via
/// the <see cref="Builder" /> property.
/// </para>
/// </remarks>
/// <exception cref="System.ArgumentNullException">
/// <paramref name="builder" /> is null.
/// </exception>
/// <seealso cref="Builder"/>
public AutoPropertiesTarget(ISpecimenBuilder builder)
{
if (builder == null)
throw new ArgumentNullException(nameof(builder));
this.builder = builder;
}
示例3: AutoConfiguredMoqCustomization
/// <summary>
/// Creates a new instance of <see cref="AutoConfiguredMoqCustomization"/>.
/// </summary>
/// <param name="relay">A mock relay to be added to <see cref="IFixture.ResidueCollectors"/></param>
public AutoConfiguredMoqCustomization(ISpecimenBuilder relay)
{
if (relay == null)
throw new ArgumentNullException("relay");
this.relay = relay;
}
示例4: Transform
/// <summary>
/// Decorates the supplied <see cref="ISpecimenBuilder" /> with an
/// <see cref="RecursionGuard"/>.
/// </summary>
/// <param name="builder">The builder to decorate.</param>
/// <returns>
/// <paramref name="builder" /> decorated with an
/// <see cref="RecursionGuard" />.
/// </returns>
public ISpecimenBuilder Transform(ISpecimenBuilder builder)
{
if (builder == null)
throw new ArgumentNullException(nameof(builder));
return new RecursionGuard(builder, new OmitOnRecursionHandler(), recursionDepth);
}
示例5: AutoNSubstituteCustomization
/// <summary>Initializes a new instance of the <see cref="AutoNSubstituteCustomization"/> class.</summary>
/// <param name="builder">The builder to use to create specimens for this customization.</param>
public AutoNSubstituteCustomization(ISpecimenBuilder builder)
{
if (builder == null)
throw new ArgumentNullException("builder");
this.builder = builder;
}
示例6: Transform
/// <summary>
/// Decorates the supplied <see cref="ISpecimenBuilder" /> with an
/// <see cref="OmitOnRecursionGuard"/>.
/// </summary>
/// <param name="builder">The builder to decorate.</param>
/// <returns>
/// <paramref name="builder" /> decorated with an
/// <see cref="OmitOnRecursionGuard" />.
/// </returns>
public ISpecimenBuilder Transform(ISpecimenBuilder builder)
{
if (builder == null)
throw new ArgumentNullException("builder");
return new OmitOnRecursionGuard(builder);
}
示例7: ResidueCollectorNode
/// <summary>
/// Initializes a new instance of the
/// <see cref="ResidueCollectorNode" /> class.
/// </summary>
/// <param name="builder">The builder to decorate.</param>
/// <remarks>
/// <para>
/// After initialization <paramref name="builder" /> is available via
/// the <see cref="Builder" /> property.
/// </para>
/// </remarks>
/// <exception cref="System.ArgumentNullException">
/// <paramref name="builder" /> is null.
/// </exception>
/// <seealso cref="Builder" />
public ResidueCollectorNode(ISpecimenBuilder builder)
{
if (builder == null)
throw new ArgumentNullException(nameof(builder));
this.Builder = builder;
}
示例8: ObjectDisposalAssertion
/// <summary>
/// Initializes a new instance of the <see cref="ObjectDisposalAssertion" /> class.
/// </summary>
/// <param name="builder">
/// The builder to create an owner object.
/// </param>
public ObjectDisposalAssertion(ISpecimenBuilder builder)
{
if (builder == null)
throw new ArgumentNullException("builder");
this.builder = builder;
}
示例9: BehaviorRoot
/// <summary>
/// Initializes a new instance of the <see cref="BehaviorRoot" />
/// class.
/// </summary>
/// <param name="builder">The builder to decorate.</param>
/// <remarks>
/// <para>
/// After initialization <paramref name="builder" /> is available via
/// the <see cref="Builder" /> property.
/// </para>
/// </remarks>
/// <exception cref="ArgumentNullException">
/// <paramref name="builder" /> is null.
/// </exception>
/// <seealso cref="Builder" />
public BehaviorRoot(ISpecimenBuilder builder)
{
if (builder == null)
throw new ArgumentNullException("builder");
this.builder = builder;
}
示例10: EqualityTestCaseProvider
public EqualityTestCaseProvider(ISpecimenBuilder specimenBuilder)
{
if (specimenBuilder == null)
{
throw new ArgumentNullException("specimenBuilder");
}
this.specimenBuilder = specimenBuilder;
}
示例11: EqualsTransitiveAssertion
public EqualsTransitiveAssertion(ISpecimenBuilder builder)
{
if (builder == null)
{
throw new ArgumentNullException("builder");
}
this.builder = builder;
}
示例12: RecursionGuard
/// <summary>
/// Initializes a new instance of the <see cref="RecursionGuard" />
/// class.
/// </summary>
/// <param name="builder">The intercepted builder to decorate.</param>
/// <param name="recursionHandler">
/// An <see cref="IRecursionHandler" /> that will handle a recursion
/// situation, if one is detected.
/// </param>
public RecursionGuard(
ISpecimenBuilder builder,
IRecursionHandler recursionHandler)
: this(builder,
recursionHandler,
EqualityComparer<object>.Default)
{
}
示例13: ShouldSavePersonWithLinks
public ShouldSavePersonWithLinks(ISession session, PersonFactory personFactory, ISpecimenBuilder specimenBuilder)
{
var links = specimenBuilder.CreateMany<LinkField>(_count).ToList();
var fake = specimenBuilder.Create<Person>();
var person = personFactory.CreatePerson(fake.Name, fake.Email, fake.Bio, Location.Georgetown, null, links);
session.SaveOrUpdate(person);
_personId = person.Id;
}
示例14: ShouldSavePersonWithCategories
public ShouldSavePersonWithCategories(ISession session, PersonFactory personFactory, ISpecimenBuilder specimenBuilder)
{
var categories = specimenBuilder.CreateMany<CategoryField>(_count).ToList();
var fake = specimenBuilder.Create<Person>();
var person = personFactory.CreatePerson(fake.Name, fake.Email, fake.Bio, Location.SanMarcos, categories);
session.SaveOrUpdate(person);
_personId = person.Id;
}
示例15: ShouldSaveApproval
public ShouldSaveApproval(ISession session, ISpecimenBuilder fixture)
{
var person = fixture.Create<Person>();
session.SaveOrUpdate(person);
var approval = new Approval { Person = person };
session.SaveOrUpdate(approval);
_approvalId = approval.Id;
}