Exemplo n.º 1
0
        public void Should_throw_argument_exception_if_numbers_sequence_is_null_or_empty(int[] numbers)
        {
            // Arrange
            var sut = new CalculatorServcie();

            // Act & Assert
            Assert.Throws <ArgumentException>(() => sut.GetStatistics(numbers));
        }
Exemplo n.º 2
0
        public void Should_return_correct_elements_count(int[] numbers, int expectedResult)
        {
            // Arrange
            var sut = new CalculatorServcie();

            // Act
            var statistics = sut.GetStatistics(numbers);

            // Assert
            statistics.Should().NotBeNull();
            statistics.ElementsCount.Should().Be(expectedResult);
        }
Exemplo n.º 3
0
        public void Should_return_correct_average_value(int[] numbers, double expectedResult)
        {
            // Arrange
            var sut = new CalculatorServcie();

            // Act
            var statistics = sut.GetStatistics(numbers);

            // Assert
            statistics.Should().NotBeNull();
            statistics.AverageValue.Should().Be(expectedResult);
        }