-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOrderManagerTest.java
72 lines (71 loc) · 2.22 KB
/
OrderManagerTest.java
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
* Bradley Estacio and Patrick Inosanto
* 12/6/19
* Test cases for OrderManager
* @see Office Supply Order System UML
*/
public class OrderManagerTest {
public static void main(String[] args)
{
try
{
//Test 1
System.out.println("Test 1");
OrderManager test1 = new OrderManager("O,Orange Inc.,A1,6/25/2004,5");
test1.addOrder("O,Macrohard Inc.,C2,8/2/2004,1");
test1.addOrder("R,Peak Enterprises,A2,11/18/2006,10,7,12/21/2006");
System.out.println(test1.toString());
System.out.println();
//Test 2
System.out.println("Test 2");
OrderManager test2 = new OrderManager("O,Orange Inc.,A1,6/25/2004,5");
test2.addOrder("O,Macrohard Inc.,C2,8/2/2004,1");
test2.addOrder("R,Peak Enterprises,A2,11/18/2006,10,7,12/21/2006");
test2.deleteOrder(1);
System.out.println(test2.toString());
//Test 3
System.out.println("Test 3");
OrderManager test3 = new OrderManager("O,Orange Inc.,A1,6/25/2004,5");
test3.addOrder("O,Macrohard Inc.,C2,8/2/2004,1");
test3.addOrder("R,Peak Enterprises,A2,11/18/2006,10,7,12/21/2006");
test3.deleteOrder(1);
test3.deleteOrder(2);
test3.deleteOrder(3);
System.out.println(test3.toString());
//Test 4
System.out.println("Test 4");
OrderManager test4 = new OrderManager("O,Orange Inc.,A1,6/25/2004,5");
test4.addOrder("O,Macrohard Inc.,C2,8/2/2004,1");
test4.addOrder("R,Orange Inc.,A2,10/6/2006,6,30,11/7/2006");
test4.listOrder("Orange Inc.");
System.out.println();
//Test 5
System.out.println("Test 5");
OrderManager test5 = new OrderManager("O,Orange Inc.,A1,6/25/2004,5");
test5.addOrder("O,Macrohard Inc.,C2,8/2/2004,1");
test5.addOrder("R,Peak Enterprises,A2,11/18/2006,10,7,12/21/2006");
test5.deleteOrder(5);
}
catch(OrderManagerException e)
{
System.out.println(e.getMessage());
}
finally
{
try
{
//Test 6
System.out.println("Test 6");
OrderManager test6 = new OrderManager("O,Orange Inc.,A1,6/25/2004,5");
test6.addOrder("O,Macrohard Inc.,C2,8/2/2004,1");
test6.addOrder("R,Peak Enterprises,A2,11/18/2006,10,7,12/21/2006");
test6.listOrder("HAL Industries");
System.out.println();
}
catch(OrderManagerException e)
{
System.out.println(e.getMessage());
}
}
}
}