GitBucket
4.23.0
Toggle navigation
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
sample-java
/
sample-junit1
Browse code
別のテストケースを追加。
master
1 parent
96163ff
commit
dbcb30d2687801f1ae6b80d439ffb40bc519b226
yhornisse
authored
on 28 Dec 2019
Patch
Showing
2 changed files
src/main/java/com/sample/App2.java
src/test/java/com/sample/App2Test.java
Ignore Space
Show notes
View
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; } }
Ignore Space
Show notes
View
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)); } }
Show line notes below