001 /**
002 * This is part of CSE 331 Problem Set 0.
003 */
004 package ps0.test;
005 import ps0.*;
006
007 import junit.framework.TestCase;
008
009 /**
010 * BallTest is a simple glassbox test of the Ball class.
011 *
012 * @see ps0.Ball
013 */
014 public class BallTest extends TestCase {
015
016 private Ball b = null;
017 private double BALL_VOLUME = 20.0;
018 private double JUNIT_DOUBLE_DELTA = 0.0001;
019
020 protected void setUp() throws Exception {
021 b = new Ball(BALL_VOLUME);
022 }
023
024 /** Test to see that Ball returns the correct volume when queried. */
025 public void testVolume() {
026 assertEquals("b.getVolume should "+BALL_VOLUME+" but it's "+b.getVolume()+" instead!",
027 BALL_VOLUME, b.getVolume(), JUNIT_DOUBLE_DELTA);
028 }
029
030 }