RoomTest - public void testOccupied Room r = 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 RoomTest 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.) */ public void testRoomDescription() { Room r = new Room("Ooze"); assertTrue (r.roomDescription().equals("Ooze"));
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 testOccupied(){ Room r = new Room("Ooze"); assertTrue (r.occupied() == false); } public void testEnter(){ Room r = new Room ("Ooze"); Explorer columbus = new Explorer("Chris", r , 100, 50); Room r2 = new Room ("Goo"); columbus.move(r2); assertTrue (r2.occupied() == true); } public void testExit(){ Room r = new Room ("Ooze"); Explorer columbus = new Explorer("Chris", r , 100, 50); Room r2 = new Room ("Goo"); columbus.move(r2); assertTrue (r.occupied() == false); } }...
View Full Document

This document was uploaded on 10/23/2009.

Ask a homework question - tutors are online