/** * */ package junit.learnnow; import static org.junit.Assert.*; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; /** * @author Michael Thomas * */ public class MyClassTest { /** * @throws java.lang.Exception */ @BeforeClass public static void setUpBeforeClass() throws Exception { System.out.println("setUpClass() - run once at class start up."); } /** * @throws java.lang.Exception */ @AfterClass public static void tearDownAfterClass() throws Exception { System.out.println("tearDownClass() - run once when class has finished."); } /** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { System.out.println("setUp() - runs before each @test method."); } /** * @throws java.lang.Exception */ @After public void tearDown() throws Exception { System.out.println("tearDown() - runs after each @test method."); } @Test public void test() { //Goal is to eventually call all test methods. System.out.println("running test()"); fail("Not yet implemented"); } @Test public void testMyMethodInt() { System.out.println("running testMyMethodInt()"); MyClass c1 = new MyClass(); assertEquals(0, c1.myMethodInt(0)); assertEquals(0, c1.myMethodInt(10)); assertEquals(1, c1.myMethodInt(11)); assertEquals(1, c1.myMethodInt(100)); assertEquals(0, c1.myMethodInt(-1)); } @Test public void testMyMethodDouble() { System.out.println("running testMyMethodDouble()"); fail("Not yet implemented"); } @Test public void testMyMethodBoolean() { System.out.println("running testMyMethodBoolean()"); fail("Not yet implemented"); } @Test public void testMyMethodString() { System.out.println("running testMyMethodString()"); fail("Not yet implemented"); } @Test public void testGoodHouseLoanRate(){ System.out.println("running testGoodHouseLoanRate()"); fail("Not yet implemented"); } }