Example #1
0
        public void PrimeNumbersCounter_ThrowAnException_ExceptionWhenWrongParameters(int min, int max)
        {
            // arrange
            var primeNumbersCounter = new PrimeNumbers.PrimeNumberCounter();

            // act & assert
            Assert.Throws <InvalidOperationException>(() => primeNumbersCounter.CountPrimeNumbers(min, max));
        }
Example #2
0
        public void PrimeNumbersCounter_CountrsNumbersInTheRange_CorrectAmountOfThePrimeNumbers(int min, int max, int result)
        {
            // arrange
            var primeNumbersCounter = new PrimeNumbers.PrimeNumberCounter();

            // act
            var amount = primeNumbersCounter.CountPrimeNumbers(min, max);

            //assert
            Assert.AreEqual(amount, result);
        }