RhinoTester - import junit.framework.TestCase; /* * A JUnit...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
import junit.framework.TestCase; /** * A JUnit test case class. * Every method starting with the word "test" will be called when running * the test with JUnit. */ public class RhinoTester extends TestCase { public void testConstructer1_Getters() { Rhino r1 = new Rhino ("Love", 7, 1986, 'M'); assertEquals ("Love", r1.getName()); assertEquals ('M', r1.getGender()); assertEquals (7, r1.getMOB()); assertEquals (1986, r1.getYOB()); assertEquals (-1, r1.getTag()); assertEquals (null, r1.getFather()); assertEquals (null, r1.getMother()); } public void testConstructer1_2_Getters() { Rhino r2 = new Rhino ("Lovem", 8, 1950, 'M'); Rhino r3 = new Rhino ("Loved", 9, 1948, 'F'); Rhino r1 = new Rhino ("Love", 7, 1986, 'M', r2, r3, 29); assertEquals ("Love", r1.getName()); assertEquals ('M', r1.getGender()); assertEquals (7, r1.getMOB()); assertEquals (1986, r1.getYOB()); assertEquals (r2, r1.getFather()); assertEquals (r3, r1.getMother()); assertEquals (29, r1.getTag()); assertEquals (0, r1.getNumberOfChildren());
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.

Page1 / 3

RhinoTester - import junit.framework.TestCase; /* * A JUnit...

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