Created
August 24, 2017 22:59
-
-
Save obetron/8ac9a195bc1c64b31789ba338952a190 to your computer and use it in GitHub Desktop.
Java basic If-Else condition example test cases
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.BeforeClass; | |
import org.junit.Test; | |
import static org.junit.Assert.assertEquals; | |
/** | |
* | |
* @author ErenBasaran | |
* Created on 25/08/2017 | |
*/ | |
public class IfElseTest { | |
private static IfElse ifElseObject; | |
private int number; | |
@BeforeClass | |
public static void beforeIfElseClass() { | |
ifElseObject = new IfElse(); | |
} | |
@Test | |
public void testCase1() { | |
number = 42; | |
assertEquals("even number", ifElseObject.checkNumber(number)); | |
} | |
@Test | |
public void testCase2() { | |
number = 1191; | |
assertEquals("odd number", ifElseObject.checkNumber(number)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment