|
@@ -24,7 +24,7 @@ public class InventoryTest {
|
24
|
24
|
Item[] items = {sulfuras};
|
25
|
25
|
Inventory sut = new Inventory(items);
|
26
|
26
|
|
27
|
|
- sut.updateQuality();
|
|
27
|
+ sut.updateInventory();
|
28
|
28
|
|
29
|
29
|
assertEquals(expectedQuality, sulfuras.getQuality());
|
30
|
30
|
}
|
|
@@ -34,7 +34,7 @@ public class InventoryTest {
|
34
|
34
|
Item[] items = {sulfuras};
|
35
|
35
|
Inventory sut = new Inventory(items);
|
36
|
36
|
|
37
|
|
- sut.updateQuality();
|
|
37
|
+ sut.updateInventory();
|
38
|
38
|
|
39
|
39
|
assertEquals(expectedSellIn, sulfuras.getSellIn());
|
40
|
40
|
}
|
|
@@ -45,7 +45,7 @@ public class InventoryTest {
|
45
|
45
|
Item[] items = {normalItem};
|
46
|
46
|
Inventory sut = new Inventory(items);
|
47
|
47
|
|
48
|
|
- sut.updateQuality();
|
|
48
|
+ sut.updateInventory();
|
49
|
49
|
|
50
|
50
|
assertEquals(expectedSellIn, normalItem.getSellIn());
|
51
|
51
|
}
|
|
@@ -56,7 +56,7 @@ public class InventoryTest {
|
56
|
56
|
Item[] items = {normalItem};
|
57
|
57
|
Inventory sut = new Inventory(items);
|
58
|
58
|
|
59
|
|
- sut.updateQuality();
|
|
59
|
+ sut.updateInventory();
|
60
|
60
|
|
61
|
61
|
assertEquals(expectedQuality, normalItem.getQuality());
|
62
|
62
|
}
|
|
@@ -68,7 +68,7 @@ public class InventoryTest {
|
68
|
68
|
Item[] items = {normalItemWithMinimumQuality};
|
69
|
69
|
Inventory sut = new Inventory(items);
|
70
|
70
|
|
71
|
|
- sut.updateQuality();
|
|
71
|
+ sut.updateInventory();
|
72
|
72
|
|
73
|
73
|
assertEquals(minimumQuality, normalItemWithMinimumQuality.getQuality());
|
74
|
74
|
}
|
|
@@ -80,7 +80,7 @@ public class InventoryTest {
|
80
|
80
|
Item[] items = {normalItemWithPassedSellDate};
|
81
|
81
|
Inventory sut = new Inventory(items);
|
82
|
82
|
|
83
|
|
- sut.updateQuality();
|
|
83
|
+ sut.updateInventory();
|
84
|
84
|
|
85
|
85
|
assertEquals(expectedQuality, normalItemWithPassedSellDate.getQuality());
|
86
|
86
|
}
|
|
@@ -92,7 +92,7 @@ public class InventoryTest {
|
92
|
92
|
Item[] items = {agedBrie};
|
93
|
93
|
Inventory sut = new Inventory(items);
|
94
|
94
|
|
95
|
|
- sut.updateQuality();
|
|
95
|
+ sut.updateInventory();
|
96
|
96
|
|
97
|
97
|
assertEquals(expectedQuality, agedBrie.getQuality());
|
98
|
98
|
}
|
|
@@ -103,7 +103,7 @@ public class InventoryTest {
|
103
|
103
|
Item[] items = {agedBrie};
|
104
|
104
|
Inventory sut = new Inventory(items);
|
105
|
105
|
|
106
|
|
- sut.updateQuality();
|
|
106
|
+ sut.updateInventory();
|
107
|
107
|
|
108
|
108
|
assertEquals(MAX_QUALITY, agedBrie.getQuality());
|
109
|
109
|
}
|
|
@@ -115,7 +115,7 @@ public class InventoryTest {
|
115
|
115
|
Item[] items = {agedBrie};
|
116
|
116
|
Inventory sut = new Inventory(items);
|
117
|
117
|
|
118
|
|
- sut.updateQuality();
|
|
118
|
+ sut.updateInventory();
|
119
|
119
|
|
120
|
120
|
assertEquals(expectedQuality, agedBrie.getQuality());
|
121
|
121
|
}
|
|
@@ -126,7 +126,7 @@ public class InventoryTest {
|
126
|
126
|
Item[] items = {backStagePass};
|
127
|
127
|
Inventory sut = new Inventory(items);
|
128
|
128
|
|
129
|
|
- sut.updateQuality();
|
|
129
|
+ sut.updateInventory();
|
130
|
130
|
|
131
|
131
|
assertEquals(0, backStagePass.getQuality());
|
132
|
132
|
}
|
|
@@ -138,7 +138,7 @@ public class InventoryTest {
|
138
|
138
|
Item[] items = {backStagePass};
|
139
|
139
|
Inventory sut = new Inventory(items);
|
140
|
140
|
|
141
|
|
- sut.updateQuality();
|
|
141
|
+ sut.updateInventory();
|
142
|
142
|
|
143
|
143
|
assertEquals(21, backStagePass.getQuality());
|
144
|
144
|
}
|
|
@@ -150,7 +150,7 @@ public class InventoryTest {
|
150
|
150
|
Item[] items = {backStagePass};
|
151
|
151
|
Inventory sut = new Inventory(items);
|
152
|
152
|
|
153
|
|
- sut.updateQuality();
|
|
153
|
+ sut.updateInventory();
|
154
|
154
|
|
155
|
155
|
assertEquals(expectedQuality, backStagePass.getQuality());
|
156
|
156
|
}
|
|
@@ -162,7 +162,7 @@ public class InventoryTest {
|
162
|
162
|
Item[] items = {backStagePass};
|
163
|
163
|
Inventory sut = new Inventory(items);
|
164
|
164
|
|
165
|
|
- sut.updateQuality();
|
|
165
|
+ sut.updateInventory();
|
166
|
166
|
|
167
|
167
|
assertEquals(expectedQuality, backStagePass.getQuality());
|
168
|
168
|
}
|
|
@@ -176,7 +176,7 @@ public class InventoryTest {
|
176
|
176
|
Item[] items = {backStagePassMoreThan10DaysAway, backStagePass10DaysAway, backStagePass5DaysAway};
|
177
|
177
|
Inventory sut = new Inventory(items);
|
178
|
178
|
|
179
|
|
- sut.updateQuality();
|
|
179
|
+ sut.updateInventory();
|
180
|
180
|
|
181
|
181
|
assertEquals(MAX_QUALITY, backStagePassMoreThan10DaysAway.getQuality());
|
182
|
182
|
assertEquals(MAX_QUALITY, backStagePass10DaysAway.getQuality());
|