hw2.test
Class FibonacciTest

java.lang.Object
  extended by hw2.test.FibonacciTest

public class FibonacciTest
extends Object

FibonacciTest is a glassbox test of the Fibonacci class. Recall that the Fibonacci sequence is a recursive sequence where the first two terms of the sequence are 1 and all subsequent terms are the sum of the previous two terms. Thus, the Fibonacci sequence starts out as 1, 1, 2, 3, 5, 8, 13... The first 1 in the sequence is considered the "0th" term, so the indices that hw2.Fibonacci uses are 0-based.

See Also:
Fibonacci

Constructor Summary
FibonacciTest()
           
 
Method Summary
 void expectedIllegalArgumentException()
          Tests that Fibonacci throws an IllegalArgumentException for a negative number.
static void setupBeforeTests()
           
 void testBaseCase()
          Tests to see that Fibonacci returns the correct value for the base cases, n=0 and n=1
 void testInductiveCase()
          Tests inductive cases of the Fibonacci sequence
 void testThrowsIllegalArgumentException()
          Tests that Fibonacci throws no IllegalArgumentException for zero or for a positive number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FibonacciTest

public FibonacciTest()
Method Detail

setupBeforeTests

public static void setupBeforeTests()
                             throws Exception
Throws:
Exception

expectedIllegalArgumentException

public void expectedIllegalArgumentException()
Tests that Fibonacci throws an IllegalArgumentException for a negative number.


testThrowsIllegalArgumentException

public void testThrowsIllegalArgumentException()
Tests that Fibonacci throws no IllegalArgumentException for zero or for a positive number.


testBaseCase

public void testBaseCase()
Tests to see that Fibonacci returns the correct value for the base cases, n=0 and n=1


testInductiveCase

public void testInductiveCase()
Tests inductive cases of the Fibonacci sequence