mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 06:21:29 +00:00
Sulfuras, being a legendary item, never has to be sold or decreases in Quality
This commit is contained in:
parent
2de3baa6b3
commit
62eed4dcef
@ -14,7 +14,7 @@
|
||||
-[x] The Quality of an item is never negative
|
||||
-[x] "Aged Brie" actually increases in Quality the older it gets
|
||||
-[x] The Quality of an item is never more than 50
|
||||
-[ ] "Sulfuras", being a legendary item, never has to be sold or decreases in Quality
|
||||
-[x] "Sulfuras", being a legendary item, never has to be sold or decreases in Quality
|
||||
-[ ] "Backstage passes", like aged brie, increases in Quality as its SellIn value approaches;
|
||||
-[ ] Quality increases by 2 when there are 10 days or less and by 3 when there are 5 days or less but
|
||||
-[ ] Quality drops to 0 after the concert
|
||||
|
||||
@ -88,4 +88,22 @@ public class GildedRoseTest {
|
||||
assertEquals(50, app.items[0].quality);
|
||||
}
|
||||
|
||||
//Sulfuras, Hand of Ragnaros
|
||||
@Test
|
||||
@DisplayName("\"Sulfuras\", being a legendary item, never has to be sold or decreases in Quality")
|
||||
public void should(){
|
||||
Item[] items = new Item[]{TestHelper.getItem("Sulfuras, Hand of Ragnaros", 0, 10)};
|
||||
GildedRose app = new GildedRose(items);
|
||||
|
||||
//day 1, don't impact quality
|
||||
app.updateQuality();
|
||||
assertEquals(10, app.items[0].quality);
|
||||
assertEquals(0, app.items[0].sellIn);
|
||||
|
||||
//day 0, don't impact quality
|
||||
app.updateQuality();
|
||||
assertEquals(10, app.items[0].quality);
|
||||
assertEquals(0, app.items[0].sellIn);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user