Beispiel #1
0
        public void Average_WhenSequnceIsNull_ShouldThrowArgumentNullException()
        {
            // arrange
            IEnumerable<double> sequence = null;

            // act
            var calcAv = new CalcAverage();
            calcAv.Average(sequence);

            // assert is handled by ExpectedException
        }
Beispiel #2
0
        public void Average_WhenSequnceIsEmpty_ShouldThrowArgumentException()
        {
            // arrange
            var sequence = new List<double>();

            // act
            var calcAv = new CalcAverage();
            calcAv.Average(sequence);

            // assert is handled by ExpectedException
        }
Beispiel #3
0
        public void Average_WithIncorrectAveraheValue()
        {
            // arrange
            var sequence = new List<double> {4, 4, 4};
            var expected = 3.6;

            // act
            var calcAv = new CalcAverage();
            var actual = calcAv.Average(sequence);

            // assert
            Assert.AreEqual(expected, actual, "Average not calculated correctly");
        }