ComputerVirusTester

ComputerVirusTester - import junit.framework.TestCase; /* *...

Info iconThis preview shows pages 1–2. 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 ComputerVirusTester 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 testfirstConstructorGetters() { ComputerVirus P1= new ComputerVirus("hopper", 3, 1998, 'W'); assertEquals("hopper", P1.getName()); assertEquals('W', P1.getType()); assertEquals(3, P1.getMOD()); assertEquals(1998, P1.getYOD()); assertEquals(null, P1.getPredecessor()); assertEquals(-1, P1.getId()); assertEquals(0, P1.getVariations()); } public void testsecondConstructor(){ ComputerVirus P1= new ComputerVirus("hopper", 3, 1998, 'W'); ComputerVirus P2= new ComputerVirus("laugh", 'L', P1, 4, 1999, 0); ComputerVirus P3= new ComputerVirus("giggle", 'L', P1, 7, 2004, 1);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 04/19/2011.

Page1 / 2

ComputerVirusTester - import junit.framework.TestCase; /* *...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online