-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiplyingMachineTest.java
More file actions
38 lines (36 loc) · 1.07 KB
/
Copy pathMultiplyingMachineTest.java
File metadata and controls
38 lines (36 loc) · 1.07 KB
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
30
31
32
33
34
35
36
37
38
/**
* The objective of the multiplying machine test is to practice
* the basic structures of OO programming: classes, objects,
* parameters, return values.
*
* @author ace
* @version 31 March 2010
*/
public class MultiplyingMachineTest
{
/**
* Constructor for objects of class MultiplyingMachineTest
*/
public MultiplyingMachineTest()
{
}
/**
* This test requires that an Multiplying machine be created
* which can add two numbers and get the appropriate result.
*/
public void testMultiplyingMachine(){
MultiplyingMachine mm = new MultiplyingMachine();
int x = mm.multiplyTwoNumbers(2, 12);
if(x == 24){
System.out.println("testMultiplyingMachine passes test1");
} else {
System.out.println("testMultiplyingMachine fails test1");
}
int y = mm.multiplyTwoNumbers(81, 76);
if(y == 6156){
System.out.println("testMultiplyingMachine passes test2");
} else {
System.out.println("testMultiplyingMachine fails test2");
}
}
}