Created
April 23, 2015 05:59
-
-
Save toagit/cf0c0b05c8112b54d3cf to your computer and use it in GitHub Desktop.
JUnit3
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
// 正常系 | |
// 例外はcatchしないことで、JUnit側でStackTraceはかせる | |
public void testOK() throws Exception { | |
} | |
// 異常系 | |
// 検証対象の例外を検証する | |
public void testException() throws Exception { | |
try { | |
fail(); | |
} catch (Exception e) { | |
assertTrue(e instaceof myException) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment