別のテストケースを追加。
1 parent 96163ff commit dbcb30d2687801f1ae6b80d439ffb40bc519b226
yhornisse authored on 28 Dec 2019
Showing 2 changed files
View
10
src/main/java/com/sample/App2.java 0 → 100644
package com.sample;
 
public class App2
{
public int mul(int x, int y)
{
return x * y;
}
}
View
43
src/test/java/com/sample/App2Test.java 0 → 100644
package com.sample;
 
import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
 
 
/**
* Unit test for simple App.
*/
public class App2Test
{
private App2 app2;
 
/**
* オブジェクトを初期化。
*/
@Before
public void setUp(){
System.out.println("setup()");
app2 = new App2();
}
 
/**
* 3 × 5 = 15 であること
*/
@Test
public void case1()
{
assertThat(app2.mul(3, 5), is(15));
}
 
/**
* 3 × 0 = 0 であること
*/
@Test
public void case2()
{
assertThat(app2.mul(3, 0), is(0));
}
}