|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hw2.test.FibonacciTest
public class FibonacciTest
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.
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 |
---|
public FibonacciTest()
Method Detail |
---|
public static void setupBeforeTests() throws Exception
Exception
public void expectedIllegalArgumentException()
public void testThrowsIllegalArgumentException()
public void testBaseCase()
public void testInductiveCase()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |