Browse Source

Committing CR-Calcu

chitraBegerhotta 6 years ago
parent
commit
baf0fb5370
6 changed files with 22 additions and 1 deletions
  1. BIN
      Operations.class
  2. 3
    1
      Operations.ctxt
  3. 4
    0
      Operations.java
  4. BIN
      OperationsTest.class
  5. 11
    0
      OperationsTest.ctxt
  6. 4
    0
      OperationsTest.java

BIN
Operations.class View File


+ 3
- 1
Operations.ctxt View File

@@ -9,4 +9,6 @@ comment2.text=\n\ The\ subtraction\ function\n\ @param\ x\ The\ first\ operand\n
9 9
 comment3.params=x\ y
10 10
 comment3.target=int\ multiply(int,\ int)
11 11
 comment3.text=\n\ The\ multiplication\ function\n\ @param\ x\ The\ first\ operand\n\ @param\ y\ The\ second\ operand\n\ @return\ x\ times\ y\n
12
-numComments=4
12
+comment4.params=x\ y
13
+comment4.target=int\ divide(int,\ int)
14
+numComments=5

+ 4
- 0
Operations.java View File

@@ -31,4 +31,8 @@ public class Operations {
31 31
     public static int multiply(int x, int y) {
32 32
         return x * y;
33 33
     }
34
+    
35
+    public static int divide(int x, int y){
36
+        return x / y;
37
+    }
34 38
 }

BIN
OperationsTest.class View File


+ 11
- 0
OperationsTest.ctxt View File

@@ -0,0 +1,11 @@
1
+#BlueJ class context
2
+comment0.target=OperationsTest
3
+comment1.params=
4
+comment1.target=void\ testAdd()
5
+comment2.params=
6
+comment2.target=void\ testSubtract()
7
+comment3.params=
8
+comment3.target=void\ testMultiply()
9
+comment4.params=
10
+comment4.target=void\ testDivide()
11
+numComments=5

+ 4
- 0
OperationsTest.java View File

@@ -16,4 +16,8 @@ public class OperationsTest {
16 16
     public void testMultiply() throws Exception {
17 17
         Assert.assertEquals(4, Operations.multiply(2, 2));
18 18
     }
19
+    @Test
20
+    public void testDivide() throws Exception {
21
+        Assert.assertEquals(3, Operations.divide(9, 3));
22
+    }
19 23
 }