|
@@ -7,7 +7,7 @@
|
7
|
7
|
* reusing classes
|
8
|
8
|
|
9
|
9
|
|
10
|
|
-# Part 1.0 - Create class `Product`
|
|
10
|
+## Part 1.0 - Create class `Product`
|
11
|
11
|
* Create a `Product` class.
|
12
|
12
|
* declare a field named `id` of type `Long`.
|
13
|
13
|
* declare a field named `price` of type `Double`.
|
|
@@ -16,7 +16,10 @@
|
16
|
16
|
* define a nullary constructor, which sets each field to a `null` value.
|
17
|
17
|
* define getters and setters for each of the fields
|
18
|
18
|
|
19
|
|
-# Part 2.0 - Create class `Inventory`
|
|
19
|
+## Part 1.1 - Test `Product`
|
|
20
|
+* Ensure 100% test-success in the `ProductTest` class
|
|
21
|
+
|
|
22
|
+## Part 2.0 - Create class `Inventory`
|
20
|
23
|
* Create an `Inventory` class.
|
21
|
24
|
* declare a field named `productList` of type `List` of `Product` objects.
|
22
|
25
|
* define a constructor, which has a paramter of type `List` of `Product` used to set the respective field.
|
|
@@ -30,8 +33,11 @@
|
30
|
33
|
* define method named `getTotalValue` which returns the product of the `quantity` and `price` field of each of the `Product` objects in the `productList` field.
|
31
|
34
|
* define getters and setters for each of the fields
|
32
|
35
|
|
|
36
|
+## Part 2.1 - Test `Inventory`
|
|
37
|
+* Ensure 100% test-success in each of the classes in the `inventory` package
|
|
38
|
+
|
33
|
39
|
|
34
|
|
-# Part 3.0 - Create class `Console`
|
|
40
|
+## Part 3.0 - Create class `Console`
|
35
|
41
|
* Create a `Console` class.
|
36
|
42
|
* declare a field named `scanner` of type `Scanner`.
|
37
|
43
|
* declare a field named `out` of type `PrintStream`.
|
|
@@ -46,8 +52,10 @@
|
46
|
52
|
* define a method named `getIntegerInput` which makes use of a `String prompt` parameter to prompt the user for some input, then returns the input of the user as a integer.
|
47
|
53
|
* define a method named `getLongInput` which makes use of a `String prompt` parameter to prompt the user for some input, then returns the input of the user as a long.
|
48
|
54
|
|
|
55
|
+## Part 3.1 - Test `Console`
|
|
56
|
+* Ensure 100% test-success `ConsoleTest` class
|
49
|
57
|
|
50
|
|
-# Part 4.0 - Create class `InventoryManager`
|
|
58
|
+## Part 4.0 - Create class `InventoryManager`
|
51
|
59
|
* Create an `InventoryManager` class.
|
52
|
60
|
* declare a field named `inventory` of type `Inventory`
|
53
|
61
|
* declare a field named `console` of type `Console`
|
|
@@ -58,4 +66,19 @@
|
58
|
66
|
* define a method named `remove` which prompts a user to input an `id` and removes a `Product` with the respective `id` from the `inventory` field.
|
59
|
67
|
* define a method named `viewProduct` which prompts a user to input an `id` and displays details about a `Product` with the repspective `id` from the `inventory field.
|
60
|
68
|
* define a method named `viewInventory` which which displays the contents of the inventory.
|
61
|
|
- * define getters and setters for each of the fields.
|
|
69
|
+ * define getters and setters for each of the fields.
|
|
70
|
+
|
|
71
|
+## Part 4.1 - Test `InventoryManager`
|
|
72
|
+* Ensure 100% test-success `Inventory` class
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+## Frequently Asked Questions
|
|
77
|
+* May I modify the test cases?
|
|
78
|
+ * uhm, no.
|
|
79
|
+* May I write my own test cases?
|
|
80
|
+ * absolutely
|
|
81
|
+* Must I write my own tests?
|
|
82
|
+ * No, but additional test-cases wouldn't hurt.
|
|
83
|
+* Why have some methods been broken into entirely new test classes?
|
|
84
|
+ * To ensure that more test cases can be written around each method in the future.
|