mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-20 08:51:08 +00:00
add tests for conjured items
This commit is contained in:
parent
3a0735e237
commit
1e257bc659
@ -11,6 +11,7 @@ public class GRItemUpdateQualityTest {
|
|||||||
private static final String AGED_BRIE = "Aged Brie";
|
private static final String AGED_BRIE = "Aged Brie";
|
||||||
private static final String SULFURAS = "Sulfuras, Hand of Ragnaros";
|
private static final String SULFURAS = "Sulfuras, Hand of Ragnaros";
|
||||||
private static final String BACKSTAGE_PASSES = "Backstage passes to a TAFKAL80ETC concert";
|
private static final String BACKSTAGE_PASSES = "Backstage passes to a TAFKAL80ETC concert";
|
||||||
|
private static final String CONJURED = "Conjured Mana Cake";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void lowersTheSellInValue() {
|
public void lowersTheSellInValue() {
|
||||||
@ -111,4 +112,21 @@ public class GRItemUpdateQualityTest {
|
|||||||
|
|
||||||
assertThat(item.getQuality()).isEqualTo(0);
|
assertThat(item.getQuality()).isEqualTo(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void conjuredItemDegradesTwiceAsFast() {
|
||||||
|
GRItem item = new GRItem(CONJURED, 10, 10);
|
||||||
|
item.updateQuality();
|
||||||
|
|
||||||
|
assertThat(item.getQuality()).isEqualTo(8);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ParameterizedTest(name = "with quality {0}")
|
||||||
|
@ValueSource(ints = {0, 1, 2})
|
||||||
|
public void conjuredItemDegradesNotBelow0(int quality) {
|
||||||
|
GRItem item = new GRItem(CONJURED, 10, quality);
|
||||||
|
item.updateQuality();
|
||||||
|
|
||||||
|
assertThat(item.getQuality()).isEqualTo(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user