Skip to content

Instantly share code, notes, and snippets.

@fkleon
Created January 31, 2013 14:39
Show Gist options
  • Save fkleon/4683266 to your computer and use it in GitHub Desktop.
Save fkleon/4683266 to your computer and use it in GitHub Desktop.
Example JUnit 4 Test class
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import bank.Customer;
import bank.VipCustomer;
public class VipCustomerTest {
private VipCustomer noob;
/**
* @throws java.lang.Exception
*/
@BeforeClass
public static void setUpBeforeClass() throws Exception {
noob = new VipCustomer("noob", "noob", "noob", "noob");
}
/**
* @throws java.lang.Exception
*/
@AfterClass
public static void tearDownAfterClass() throws Exception {
// cleanup here
}
@Test
public void testVipName() throws Exception {
String fullName = noob.getFullname();
assertEquals(fullName, "noob noob");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment