Skip to content

Commit 7c0156a

Browse files
authored
Unit Test
1 parent 53236c3 commit 7c0156a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package mypackage;
2+
3+
import org.junit.Test;
4+
import static org.hamcrest.CoreMatchers.is;
5+
import static org.junit.Assert.assertThat;
6+
7+
public class CalculatorTest {
8+
@Test
9+
public void twoAndThreeIsFive() throws Exception {
10+
final long result = new Calculator().addFucn(2, 3);
11+
assertThat(result, is(5L));
12+
}
13+
14+
@Test
15+
public void threeMinusTwoIsOne() throws Exception {
16+
final long result = new Calculator().subFucn(2, 3);
17+
assertThat(result, is(1L));
18+
}
19+
20+
@Test
21+
public void threeXThreeIsNine() throws Exception {
22+
final long result = new Calculator().mulFucn(3, 3);
23+
assertThat(result, is(9L));
24+
}
25+
26+
}

0 commit comments

Comments
 (0)