示例#1
0
        public void FibonacciSequenceTest3()
        {
            FibonacciSequence fs = new FibonacciSequence();

            int[] expected = new int[] { 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987 };
            int[] actual   = fs.GetNumbersOfSequence(16);

            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void FibonacciSequenceTest2()
        {
            FibonacciSequence fs = new FibonacciSequence();

            int[] expected = new int[] { 1 };
            int[] actual   = fs.GetNumbersOfSequence(1);

            Assert.AreEqual(expected, actual);
        }
示例#3
0
        public void FibonacciSequenceOverflowTest()
        {
            FibonacciSequence fs = new FibonacciSequence();

            Assert.Throws <OverflowException>(() => fs.GetNumbersOfSequence(1000), "Seems like one of numbers of your sequence is too big.");
        }
示例#4
0
        public void FibonacciSequenceNegativeNumberTest()
        {
            FibonacciSequence fs = new FibonacciSequence();

            Assert.Throws <ArgumentException>(() => fs.GetNumbersOfSequence(-1), "The sequence number cant't be less or equal to 0");
        }