TownTester - public void testTown() { Town ithaca= new...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import junit.framework.TestCase; i /** * A JUnit test case class. * Every method starting with the word "test" will be called when running * the test with JUnit. */ public class TownTester extends TestCase { /** * A test method. * (Replace "X" with a name describing the test. You may write as * many "testSomething" methods in this class as you wish, and each * one will be called when running JUnit over this class.) */
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public void testTown() { Town ithaca= new Town("Town of Ithaca", 10, 30000); assertEquals("Town of Ithaca has area 10 sq miles and has population 30000", ithaca.toString()); assertEquals(30000, ithaca.getPopulation()); ithaca.setPopulation(28000); assertEquals(28000, ithaca.getPopulation()); assertEquals("Town of Ithaca has area 10 sq miles and has population 28000", ithaca.toString()); } }...
View Full Document

This document was uploaded on 02/24/2010.

Ask a homework question - tutors are online