private static IFixture CreateFixture(FakeCreationMode fakeCreationMode, params Type[] specimenBuilders) { var fixture = new Fixture(); if (fakeCreationMode == FakeCreationMode.Strict) { var autoFakeItEasyCustomization = new AutoFakeItEasyCustomization { Relay = new FakeItEasyStrictSpecimenBuilder() }; fixture.Customize(autoFakeItEasyCustomization); } else { fixture.Customize(new AutoFakeItEasyCustomization()); } fixture.Customize(new DefaultCustomization()); if (specimenBuilders != null && specimenBuilders.Length > 0) { fixture.Customize(new CustomSpecimenBuildersCustomization(specimenBuilders)); } return(fixture); }
/// <summary> /// Initializes a new instance of the <see cref="InlineAutoFakeItEasyDataAttribute" /> class. /// </summary> /// <param name="fakeCreationMode">The fake creation mode.</param> /// <param name="specimenBuilder1">The specimen builder1.</param> /// <param name="specimenBuilder2">The specimen builder2.</param> /// <param name="specimenBuilder3">The specimen builder3.</param> /// <param name="specimenBuilder4">The specimen builder4.</param> /// <param name="specimenBuilder5">The specimen builder5.</param> /// <param name="values">The values.</param> public InlineAutoFakeItEasyDataAttribute(FakeCreationMode fakeCreationMode, Type specimenBuilder1, Type specimenBuilder2, Type specimenBuilder3, Type specimenBuilder4, Type specimenBuilder5, params object[] values) : base(new DataAttribute[] { new InlineDataAttribute(values), new AutoFakeItEasyDataAttribute(fakeCreationMode, specimenBuilder1, specimenBuilder2, specimenBuilder3, specimenBuilder4, specimenBuilder5) }) { }
/// <summary> /// Initializes a new instance of the <see cref="InlineAutoFakeItEasyDataAttribute" /> class. /// </summary> /// <param name="fakeCreationMode">The fake creation mode.</param> /// <param name="values">The values.</param> public InlineAutoFakeItEasyDataAttribute(FakeCreationMode fakeCreationMode, params object[] values) : base(new DataAttribute[] { new InlineDataAttribute(values), new AutoFakeItEasyDataAttribute(fakeCreationMode) }) { }
/// <summary> /// Initializes a new instance of the <see cref="AutoFakeItEasyDataAttribute" /> class. /// </summary> /// <param name="fakeCreationMode">The fake creation mode.</param> /// <param name="specimenBuilders">The specimen builders.</param> public AutoFakeItEasyDataAttribute(FakeCreationMode fakeCreationMode, params Type[] specimenBuilders) : base(() => { return(CreateFixture(fakeCreationMode, specimenBuilders)); }) { }
/// <summary> /// Initializes a new instance of the <see cref="AutoFakeItEasyDataAttribute" /> class. /// </summary> /// <param name="fakeCreationMode">The fake creation mode.</param> /// <remarks> /// This constructor overload initializes the <see cref="P:AutoFixture.Xunit.AutoDataAttribute.Fixture" /> to an instance of /// <see cref="P:AutoFixture.Xunit.AutoDataAttribute.Fixture" />. /// </remarks> public AutoFakeItEasyDataAttribute(FakeCreationMode fakeCreationMode) : base(() => { return(CreateFixture(fakeCreationMode)); }) { }