Using AutoFixture as a SutFactory, I can see that if I register or freeze a value for a type, that value will then be used for all subsequent usages of that type. However, if I have a class with two parameters that are the same type on the constructor such as:
public class ClassA
{
public double ParameterA { get; private set;}
public double ParameterB { get; private set;}
public ClassA(double parameterA, double parameterB)
{
ParameterA = parameterA;
ParameterB = parameterB;
}
public void Execute(ClassB object)
{
object.Value = (object.Value * ParameterA) /ParameterB;
}
}
What strategies exist for using autofixture to inject unique pre-defined values for parameterA and parameterB with a view to testing the Calculated value?
*Unfortunately I can't share my exact scenario here, however its using the command pattern to operate on another object, so the only way of setting parameterA and parameterB maintaining the design is to inject them both in, and the constructor is the neatest way to do this in this case.