public void ArithMeanTest(double firstValue, double secondValue, double expected) { var calculator = new ArithmeticMeanCalculator(); var actualResult = calculator.Calculate(firstValue, secondValue); Assert.AreEqual(expected, actualResult, 0.001); }
public void SetupObjectsForTests() { calculator = new ArithmeticMeanCalculator(); }
/// <summary> /// Calculates the arithmetic mean of the given numbers. /// </summary> /// <param name="numbers">The numbers whose arithmetic mean is to be calculated.</param> /// <returns> /// The arithmetic mean of the given numbers. /// </returns> /// <exception cref="System.InvalidOperationException"> /// The specified collection must not be empty. /// </exception> /// <exception cref="System.ArgumentNullException"> /// The specified collection must not be null. /// </exception> public static double ArithmeticMean(this IEnumerable <double> numbers) { return(ArithmeticMeanCalculator.ArithmeticMean(numbers)); }