Created
November 8, 2011 08:23
-
-
Save ryu22e/1347282 to your computer and use it in GitHub Desktop.
入れ子構造になっているJUnit4テストの書き方
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
package org.ryu22e; | |
import org.junit.Test; | |
import org.junit.experimental.runners.Enclosed; | |
import org.junit.runner.RunWith; | |
/** | |
* @author ryu22e | |
* @see <a href="http://d.hatena.ne.jp/shuji_w6e/20111205/1323098690">http://d.hatena.ne.jp/shuji_w6e/20111205/1323098690</a> | |
*/ | |
@RunWith(Enclosed.class) | |
public class PlayerTest { | |
public static class 打率の計算ができる { | |
@Test | |
public void 安打数を打数で割って打率を求める() throws Exception { | |
// TODO テストの内容を書く。 | |
} | |
} | |
public static class 値の丸めができる { | |
@Test | |
public void 小数点第4位が4以下なら切り捨て() throws Exception { | |
// TODO テストの内容を書く。 | |
} | |
@Test | |
public void 小数点第4位が5以上なら切り上げ() throws Exception { | |
// TODO テストの内容を書く。 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment