public void IsFibonacciNumber_True() { // Act var response = _repository.IsFibonacciNumber(5); // Assert Assert.True(response); }
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); }
public long GetNextFibonacciNumber(long number) { if (_repository.IsFibonacciNumber(number)) { return(_repository.GetNextFibonacciNumber(number)); } else { throw new InvalidFibonacciNumberException(number); } }