|
|
@@ -11,11 +11,13 @@ public class InventoryTest {
|
|
11
|
11
|
|
|
12
|
12
|
private Item sulfuras;
|
|
13
|
13
|
private Item normalItem;
|
|
|
14
|
+ private Item conjuredItem;
|
|
14
|
15
|
|
|
15
|
16
|
@Before
|
|
16
|
17
|
public void setup(){
|
|
17
|
18
|
sulfuras = new Item("Sulfuras, Hand of Ragnaros", 0, 80);
|
|
18
|
19
|
normalItem = new Item(NORMAL_ITEM_NAME, 10, 20);
|
|
|
20
|
+ conjuredItem = new Item("Conjured Mana Biscuit", 10, 30);
|
|
19
|
21
|
}
|
|
20
|
22
|
|
|
21
|
23
|
@Test
|
|
|
@@ -182,4 +184,27 @@ public class InventoryTest {
|
|
182
|
184
|
assertEquals(MAX_QUALITY, backStagePass10DaysAway.getQuality());
|
|
183
|
185
|
assertEquals(MAX_QUALITY, backStagePass5DaysAway.getQuality());
|
|
184
|
186
|
}
|
|
|
187
|
+ //-------------------------Conjured Item-----------------------------
|
|
|
188
|
+ @Test
|
|
|
189
|
+ public void testUpdate_for_ConjuredItem() throws Exception {
|
|
|
190
|
+ int expectedQuality = conjuredItem.getQuality() - 2;
|
|
|
191
|
+ Item[] items = {conjuredItem};
|
|
|
192
|
+ Inventory sut = new Inventory(items);
|
|
|
193
|
+
|
|
|
194
|
+ sut.updateQuality();
|
|
|
195
|
+
|
|
|
196
|
+ assertEquals(expectedQuality, conjuredItem.getQuality());
|
|
|
197
|
+ }
|
|
|
198
|
+
|
|
|
199
|
+ @Test
|
|
|
200
|
+ public void testUpdate_for_ConjuredItem_PastSellBy() throws Exception {
|
|
|
201
|
+ Item conjuredItemPastSellBy = new Item("Conjured Mana Biscuit", -1, 30);
|
|
|
202
|
+ int expectedQuality = conjuredItemPastSellBy.getQuality() - 4;
|
|
|
203
|
+ Item[] items = {conjuredItemPastSellBy};
|
|
|
204
|
+ Inventory sut = new Inventory(items);
|
|
|
205
|
+
|
|
|
206
|
+ sut.updateQuality();
|
|
|
207
|
+
|
|
|
208
|
+ assertEquals(expectedQuality, conjuredItemPastSellBy.getQuality());
|
|
|
209
|
+ }
|
|
185
|
210
|
}
|