hw2.test
Class BallContainerTest

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

public class BallContainerTest
extends Object

BallContainerTest is a glassbox test of the BallContainer class. Recall that the BallContainer is a container for Balls. However, you can only put a Ball into a BallContainer once. After you put the Ball into the BallContainer, further attempts to do so will fail, since the Ball is already in the BallContainer! Similarly, you cannot expect to remove a Ball from a BallContainer if it is not inside the BallContainer.

See Also:
Ball, BallContainer

Constructor Summary
BallContainerTest()
           
 
Method Summary
static void setupForTests()
           
 void testAdd()
          Test to check that BallContainer.add(Ball) is implemented correctly
 void testClear()
          Test that BallContainer.clear() is implemented correctly.
 void testContains()
          Test that size() returns the correct number.
 void testIterator()
          Test to check that BallContainer.iterator() is implemented correctly.
 void testRemove()
          Test to check that BallContainer.remove(Ball) is implemented correctly
 void testSize()
          Test that size() returns the correct number.
 void testVolume()
          Test that we can put a Ball into a BallContainer
 void testVolumeAfterClear()
          Test that clear removes all balls.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BallContainerTest

public BallContainerTest()
Method Detail

setupForTests

public static void setupForTests()
                          throws Exception
Throws:
Exception

testAdd

public void testAdd()
Test to check that BallContainer.add(Ball) is implemented correctly


testRemove

public void testRemove()
Test to check that BallContainer.remove(Ball) is implemented correctly


testIterator

public void testIterator()
Test to check that BallContainer.iterator() is implemented correctly.


testClear

public void testClear()
Test that BallContainer.clear() is implemented correctly.


testVolume

public void testVolume()
Test that we can put a Ball into a BallContainer


testSize

public void testSize()
Test that size() returns the correct number.


testContains

public void testContains()
Test that size() returns the correct number.


testVolumeAfterClear

public void testVolumeAfterClear()
Test that clear removes all balls.