Пример #1
0
        public void Fibonacci_ValidInput_SequenceOfFibonacciNumbers(int count, int[] expectedArray)
        {
            var resultArray = new int[count];
            int cnt         = 0;

            foreach (var element in CollectionsExtensions.Fibonacci(count))
            {
                resultArray[cnt++] = (int)element;
            }

            Assert.IsTrue(IsTheSameArrays(resultArray, expectedArray));
        }
Пример #2
0
 public void Fibonacci_InvalidInput_ExpectedArgumentOutOfRangeException(int count)
 => Assert.Throws <ArgumentOutOfRangeException>(() => CollectionsExtensions.Fibonacci(count));