forked from KByrne12/CSCI430_Project1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTester.java
More file actions
30 lines (22 loc) · 859 Bytes
/
Tester.java
File metadata and controls
30 lines (22 loc) · 859 Bytes
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
import java.util.*;
import java.text.*;
import java.io.*;
public class Tester {
public static void main(String[] s) {
Product P1 = new Product("Headphone", "p1",20, 2000);
Product P2 = new Product("Phone","p2", 10, 4000);
final ProductList P;
P = ProductList.instance();
// Testing Product Class
System.out.println(P1.getName() + " should be Headphone.");
System.out.println(P2.getName() + " should be Phone.");
System.out.println(P1.getQuantity() + " should be 20.");
System.out.println(P2.getQuantity() + " should be 10.");
System.out.println(P1.getPrice() + " should be 2000.");
System.out.println(P2.getPrice() + " should be 4000.");
// Testing ProductList Class
P.insertProduct(P1);
P.insertProduct(P2);
System.out.println(P.toString());
}
}