Пример #1
0
        public void GetNextFibonacciNumber_Success()
        {
            // Arrange
            var expected = 8;

            // Act
            var response = _repository.GetNextFibonacciNumber(5);

            // Assert
            Assert.Equal(expected, response);
        }
Пример #2
0
 public long GetNextFibonacciNumber(long number)
 {
     if (_repository.IsFibonacciNumber(number))
     {
         return(_repository.GetNextFibonacciNumber(number));
     }
     else
     {
         throw new InvalidFibonacciNumberException(number);
     }
 }
Пример #3
0
        public void GetNextFibonacciNumber_Success()
        {
            // Arrange
            var expectedResponse = 514229;

            _repository.IsFibonacciNumber(Arg.Any <long>()).Returns(true);
            _repository.GetNextFibonacciNumber(Arg.Any <long>()).Returns(expectedResponse);

            //Act
            var response = _service.GetNextFibonacciNumber(317811);

            //Assert
            Assert.Equal(514229, response);
        }