|
@@ -10,7 +10,8 @@ public class InventoryTest {
|
10
|
10
|
Item backstagePasses = new Item("Backstage passes to a TAFKAL80ETC concert", 5, 10);
|
11
|
11
|
Item sulfuras = new Item("Sulfuras, Hand of Ragnaros", 15, 15);
|
12
|
12
|
Item random = new Item("Random Items", 0, 7);
|
13
|
|
- Item[] items = {agedBrie, backstagePasses, sulfuras, random};
|
|
13
|
+ Item conjured = new Item("Conjured", 20, 42);
|
|
14
|
+ Item[] items = {agedBrie, backstagePasses, sulfuras, random, conjured};
|
14
|
15
|
Inventory inventory = new Inventory(items);
|
15
|
16
|
|
16
|
17
|
@Test
|
|
@@ -55,5 +56,18 @@ public class InventoryTest {
|
55
|
56
|
// Then
|
56
|
57
|
Assert.assertEquals(expected, actual);
|
57
|
58
|
}
|
|
59
|
+
|
|
60
|
+ @Test
|
|
61
|
+ public void updateQuantityTest4() {
|
|
62
|
+ // Given
|
|
63
|
+ int expected = 42 - 1 - 2 - 39 + 1;
|
|
64
|
+
|
|
65
|
+ // When
|
|
66
|
+ inventory.updateQuality();
|
|
67
|
+ int actual = conjured.getQuality();
|
|
68
|
+
|
|
69
|
+ // Then
|
|
70
|
+ Assert.assertEquals(expected, actual);
|
|
71
|
+ }
|
58
|
72
|
}
|
59
|
73
|
|