public void should_correctly_calculate_step_curve_value(float slope, float xShift, float yShift, float inputValue, float expectedValue) { var curve = new StepCurveFunction(slope, xShift, yShift); var actualValue = curve.Plot(inputValue); Assert.Equal(expectedValue.ToString("F"), actualValue.ToString("F")); }
public static StepCurveFunction Alter(this StepCurveFunction curve, float?stepValue = null, float?minValue = null, float?maxValue = null) { return(new StepCurveFunction( stepValue.HasValue ? stepValue.Value : curve.StepValue, minValue.HasValue ? minValue.Value : curve.MinValue, maxValue.HasValue ? maxValue.Value : curve.MaxValue )); }