Created
January 31, 2013 14:39
-
-
Save fkleon/4683266 to your computer and use it in GitHub Desktop.
Example JUnit 4 Test class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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