Beispiel #1
0
        public void CalculateGeometricMeanShouldReturnCorrectResult4()
        {
            var values = new List <decimal> {
                12m, 4m, 2m
            };
            var result = new MathCalculatorService().CalculateGeometricMean(values);

            result.Should().Be(4.57m);
        }
Beispiel #2
0
        public void CalculateGeometricMeanShouldReturnCorrectResult3()
        {
            var values = new List <decimal> {
                0.1m, 0.2m, 0.3m, 0.4m, 0.5m
            };
            var result = new MathCalculatorService().CalculateGeometricMean(values);

            result.Should().Be(0.26m);
        }
Beispiel #3
0
        public void CalculateGeometricMeanShouldReturnZeroForAListOfZeros()
        {
            var values = new List <decimal> {
                0, 0
            };
            var result = new MathCalculatorService().CalculateGeometricMean(values);

            result.Should().Be(0);
        }
Beispiel #4
0
        public void CalculateGeometricMeanShouldReturnCorrectResult1()
        {
            var values = new List <decimal> {
                1.05m, 1.03m, 0.94m, 1.02m, 1.04m
            };
            var result = new MathCalculatorService().CalculateGeometricMean(values);

            result.Should().Be(1.02m);
        }
Beispiel #5
0
        public void CalculateGeometricMeanShouldReturnCorrectResult5()
        {
            var values = new List <decimal> {
                23.5m, 33.6m, -18.8m, 14.4m, -14.9m, -1m, 3m, 96.2m, 3.4m, 0m
            };
            var result = new MathCalculatorService().CalculateGeometricMean(values);

            result.Should().Be(10.44m);
        }