예제 #1
0
        public void FibonacciPrintSequenceOfNumbers()
        {
            FibonacciNumbers fib = new FibonacciNumbers();
            int    length        = 7;
            string expected      = "0 1 1 2 3 5 8";
            string actual        = fib.ToString(fib.GetSequence(length));

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        public void FibonacciShouldPrintAVariableSequenceOfNumbers()
        {
            FibonacciNumbers fib = new FibonacciNumbers();
            int input            = 8;

            int[] expected = new int[] { 0, 1, 1, 2, 3, 5, 8, 13 };
            int[] actual   = fib.GetSequence(input);
            CollectionAssert.AreEqual(expected, actual);
        }