Exemplo n.º 1
0
 /// <summary>
 /// Adds the specified composer transformation function as an AutoFixture customization.
 /// </summary>
 /// <typeparam name="TModel">The type of the model.</typeparam>
 /// <param name="fixture">The fixture.</param>
 /// <param name="composer">The composer.</param>
 /// <returns></returns>
 public static ITestFixture HavingAutoFixtureCustomization <TModel>(this ITestFixture fixture,
                                                                    Func <Faker, ICustomizationComposer <TModel>, ISpecimenBuilder> composer) =>
 fixture.HavingAutoFixture(f => f.Customize <TModel>(c => composer(fixture.Faker, c)));
Exemplo n.º 2
0
 /// <summary>
 /// Adds the specified composer transformation function as an AutoFixture customization.
 /// </summary>
 /// <param name="fixture">The fixture.</param>
 /// <param name="specimenBuilder">The specimen builder.</param>
 /// <returns></returns>
 public static ITestFixture HavingAutoFixtureCustomization(this ITestFixture fixture,
                                                           ISpecimenBuilder specimenBuilder) =>
 fixture.HavingAutoFixture(f => f.Customizations.Add(specimenBuilder));
Exemplo n.º 3
0
 /// <summary>
 /// Adds the specified behavior to the auto fixture instance.
 /// </summary>
 /// <param name="fixture">The fixture.</param>
 /// <param name="behavior">The behavior.</param>
 /// <returns></returns>
 public static ITestFixture HavingAutoFixtureBehavior(this ITestFixture fixture, ISpecimenBuilderTransformation behavior) =>
 fixture.HavingAutoFixture(f => f.Behaviors.Add(behavior));