Developer's Daily Java Education - Test Projects
  front page | java | perl | unix | DevDirectory
   
Front Page
Java
Education
   
 


package com.missiondata.wb;

//  need to add "junit.ui.TestRunner" to
//  Project  Project Properties  Run ... VM Parameters for JBuilder

import junit.framework.*;

public class _Pizza extends TestCase
{

  /**
   * Set up work to be done before each test.
   */
  protected void setUp()
  {
    //sum   = 0.0;
    //price = 0.0;
  }

  /**
   * Cleanup work to do after each test.
   */
  protected void tearDown()
  {
  }


  //---------------------------------------------------------------------------------------------//

  public void testAddTopping()
  {
    Pizza pizza = new Pizza();
    pizza.addTopping(Pizza.CHEESE_TOPPING);
    assertEquals(1,pizza.getNumberOfToppings());
  }

  //---------------------------------------------------------------------------------------------//

  public static void main(String args[])
  {
    junit.textui.TestRunner.run(_Pizza.class);
  }

  public _Pizza(String name)
  {
    super(name);
  }

  /**
   * add one line here for each test in the suite
   */
  public static Test suite()
  {
    TestSuite suite = new TestSuite();

    // run tests manually
    //suite.addTest( new _Pizza("testBlank") );
    //suite.addTest( new _Pizza("testNull") );
    //suite.addTest( new _Pizza("testAtSymbols") );
    //return suite;

    // or, run tests dynamically
    return new TestSuite(_Pizza.class);
  }

}
Copyright © 1998-2003 DevDaily Interactive, Inc.
All Rights Reserved.