public void GetFibonacciNumber_ArgumentOutOfRangeExceptionTests(int count, int firstNumber) { Assert.Throws <ArgumentOutOfRangeException>(() => { FibonacciNumbers fibonacciNumbersGetter = new FibonacciNumbers(firstNumber); foreach (var fibonacciNumber in fibonacciNumbersGetter.GetFibonacciNumber(count)) { } }); }
public int[] GetFibonacciNumberTests(int count, int firstNumber) { FibonacciNumbers fibonacciNumbersGetter = new FibonacciNumbers(firstNumber); int[] result = new int[count]; int i = 0; foreach (var fibonacciNumber in fibonacciNumbersGetter.GetFibonacciNumber(count)) { result[i++] = fibonacciNumber; } return(result); }
public int[] GetFibonacciNumber_GetFibonacciNumbersWithEmptyConstructorTests(int count) { FibonacciNumbers fibonacciNumbersGetter = new FibonacciNumbers(); int[] result = new int[count]; int i = 0; foreach (var fibonacciNumber in fibonacciNumbersGetter.GetFibonacciNumber(count)) { result[i++] = fibonacciNumber; } return(result); }