Last active
May 7, 2017 14:18
-
-
Save kodaitakahashi/37f6d65a300bf252041410b4cbd84c06 to your computer and use it in GitHub Desktop.
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
public BasicSyntax{ | |
import static org.hamcrest.core.Is.is; | |
import static org.junit.Assert.assertThat; | |
import org.junit.Before; | |
import org.junit.Test; | |
Main sut = null; // テスト対象となるクラスのインスタンス | |
@Before // 共通する前処理を記述 | |
// 例 | |
public void setUp(){ | |
Main sut = new Main(); | |
} | |
@Test //テストメソッドを定義する | |
// 例 int sum(int, int)という足し算をするメソッドの正常系テスト | |
public void 整数5と5を_sumに渡すと_10が返ってくる() throws Exception{ | |
int actual = sut.sum(5, 5); // 実則値 | |
int expected = 10; // 期待値 | |
assertThat(actual, is(expected)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment