123456789101112131415161718192021222324252627282930 |
- import org.junit.Test;
- import org.junit.Assert;
-
- public class OperationsTest {
- @Test
- public void testAdd() throws Exception {
- Assert.assertEquals(2, Operations.add(1, 1));
- }
-
- @Test
- public void testSubtract() throws Exception {
- Assert.assertEquals(0, Operations.subtract(1, 1));
- }
-
- @Test
- public void testMultiply() throws Exception {
- Assert.assertEquals(4, Operations.multiply(2, 2));
- }
-
- @Test
- public void testDivide() throws Exception{
- Operations operations = new Operations();
- int x = 10;
- int y = 2;
- int expected = 5;
- int actual = operations.divide(x,y);
- Assert.assertEquals(expected, actual);
- }
- }
|