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); }
public void FibonacciSequenceTest2() { FibonacciSequence fs = new FibonacciSequence(); int[] expected = new int[] { 1 }; int[] actual = fs.GetNumbersOfSequence(1); Assert.AreEqual(expected, actual); }
public void FibonacciSequenceOverflowTest() { FibonacciSequence fs = new FibonacciSequence(); Assert.Throws <OverflowException>(() => fs.GetNumbersOfSequence(1000), "Seems like one of numbers of your sequence is too big."); }
public void FibonacciSequenceNegativeNumberTest() { FibonacciSequence fs = new FibonacciSequence(); Assert.Throws <ArgumentException>(() => fs.GetNumbersOfSequence(-1), "The sequence number cant't be less or equal to 0"); }