コード例 #1
0
 public void FibShouldPrintSequenceOfNumbers()
 {
     FibNumbers fib = new FibNumbers();
     int[] expected = new int[] { 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 };
     int[] actual = fib.GetSequence();
     CollectionAssert.AreEqual(expected, actual);
 }
コード例 #2
0
 public void FibShouldPrintAVariableSequenceOfNumbers()
 {
     FibNumbers fib = new FibNumbers();
     int input = 12;
     int[] expected = new int[] {1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 };
     int[] actual = fib.GetSequence(input);
     CollectionAssert.AreEqual(expected, actual);
 }
コード例 #3
0
 public void FibPrintSequenceOfNumbers()
 {
     FibNumbers fib = new FibNumbers();
     int length = 7;
     string expected = "1 1 2 3 5 8 13";
     string actual = fib.ToString(fib.GetSequence(length));
     Assert.AreEqual(expected, actual);
 }