Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public BasicSyntax{
import static;
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 整数55を_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
You can’t perform that action at this time.