Having used the features a bit more, I have personally found that there are not too many objects where this happens, so creating a simple customization for the class is probably best here, e.g.:
public class ClassACustomization: ICustomization
{
public double ParameterA { get; set;}
public double ParameterB { get; set;}
public void Customize(IFixture fixture)
{
//Note: these can be initialized how you like, shown here simply for convenience.
ParameterA = fixture.Create<double>();
ParameterB = fixture.Create<double>();
fixture.Customize<ClassA>(c => c
.FromFactory(() =>
new ClassA(ParameterA , ParameterB )));
}
}
I find that this still gives me the flexibility that is great about AutoFixture, without compromising on the ability to inject in specific instances of ParameterA or ParameterB (you could set them up using builder methods, constructor etc... Instead of in the customization to Random values).