Methods Summary |
---|
public static void | oneTimeSetup()
System.out.println("oneTimeSetUp");
|
public static void | oneTimeTearDown()
System.out.println("oneTimeTearDown");
|
public static junit.framework.Test | suite()
TestSetup setup = new TestSetup(new TestSuite(TestPerson.class)) {
protected void setUp() throws Exception {
oneTimeSetup();
}
protected void tearDown() throws Exception {
oneTimeTearDown();
}
};
return setup;
|
public void | testGetFullName()TestAll the name concatenation feature of Person.
Person p = new Person("Aidan", "Burke");
assertEquals("Aidan Burke", p.getFullName());
|
public void | testNullsInName()Verify that nulls are handled properly.
fail("sample failure");
Person p = new Person(null, "Burke");
assertEquals("? Burke", p.getFullName());
p = new Person("Tanner", null);
assertEquals("Tanner ?", p.getFullName());
|
public void | testPassNullsToConstructor()
try {
Person p = new Person(null, null);
fail("Expected IllegalArgumentException because both args are null");
} catch (IllegalArgumentException expected) {
// ignore this because it means the test passed!
}
|