예제 #1
0
        public void TestLinear1()
        {
            var data = new CalculationData(10000, 0, 5);
            var rounding = new DefaultRounding();
            var calc = new Linear();

            TestResult(rounding.Calculate(calc, data, 0), 10000, 0);
            TestResult(rounding.Calculate(calc, data, 1), 8000, 2000);
            TestResult(rounding.Calculate(calc, data, 2), 6000, 2000);
            TestResult(rounding.Calculate(calc, data, 3), 4000, 2000);
            TestResult(rounding.Calculate(calc, data, 4), 2000, 2000);
            TestResult(rounding.Calculate(calc, data, 5), 0, 2000);
        }
예제 #2
0
 /// <summary>
 /// Initialisiert eine neue Instanz der <see cref="DegressiveToLinear"/> Klasse.
 /// </summary>
 /// <param name="degressiveMethod">Das degressive Verfahren, das zu Beginn zu benutzen ist</param>
 public DegressiveToLinear(IDegressiveCalculationMethod degressiveMethod)
 {
     DegressiveMethod = degressiveMethod;
     LinearMethod = new Linear();
 }
예제 #3
0
 /// <summary>
 /// Initialisiert eine neue Instanz der <see cref="DegressiveToLinear"/> Klasse.
 /// </summary>
 /// <param name="degressiveMethod">Das degressive Verfahren, das zu Beginn zu benutzen ist</param>
 public DegressiveToLinear(IDegressiveCalculationMethod degressiveMethod)
 {
     DegressiveMethod = degressiveMethod;
     LinearMethod     = new Linear();
 }