public void Test_AverageByMean_With_Interfce()
        {
            ICalculator calculator = new MeanCalculator();

            double expected = 8.3636363;

            double actual = calculator.CalculateAverage(values);

            Assert.AreEqual(expected, actual, 0.000001);
        }
示例#2
0
        public void Test_AverageByMean_With_Delegate()
        {
            Calculator calculator = new Calculator();

            double expected = 8.3636363;

            var meanCalculator = new MeanCalculator();

            double actual = calculator.CalculateAverage(values, meanCalculator.Calculat);

            Assert.AreEqual(expected, actual, 0.000001);
        }