import org junit Assert public class SimpleMathTest SimpleMath math or

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import org.junit.Assert;
public class SimpleMathTest {
SimpleMath math;
@org.junit.Before
public void setUp() throws Exception {
math = new SimpleMath();
}
@org.junit.Test
public void testSum() throws Exception {
Assert.assertTrue(math.sum(4, 5) == 9);
Assert.assertTrue(math.sum(0, 0) == 0);
Assert.assertTrue(math.sum(0, -1) == -1);
Assert.assertTrue(math.sum(6, -6) == 0);
Assert.assertTrue(math.sum(15, -9) == 6);
}
@org.junit.Test
public void testDifference() throws Exception {
Assert.assertTrue(math.difference(4, 5) == -1);
Assert.assertTrue(math.difference(0, 0) == 0);
Assert.assertTrue(math.difference(0, -1) == 1);
Assert.assertTrue(math.difference(6, -6) == 12);
Assert.assertTrue(math.difference(15, 5) == 10);
}
}