Using AutoFixture as a SutFactory , I see that if I register or freeze a value for a type, this value will then be used for all subsequent applications of this type. However, if I have a class with two parameters that have the same type in the constructor, for example:
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 enter unique predefined values for parameter A and parameter B in order to test the Estimated value?
* Unfortunately, I can’t share my exact script here, however its using the command template to work with another object, therefore the only way to set parameter A and parameter B that supports the design is to enter them both in and the constructor is the easiest way do it in this case.
c # tdd autofixture
gmn
source share