mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 06:21:29 +00:00
Backstage passes, like aged brie, increases in Quality as its SellIn value approaches
This commit is contained in:
parent
62eed4dcef
commit
6731e834ef
@ -15,7 +15,7 @@
|
|||||||
-[x] "Aged Brie" actually increases in Quality the older it gets
|
-[x] "Aged Brie" actually increases in Quality the older it gets
|
||||||
-[x] The Quality of an item is never more than 50
|
-[x] The Quality of an item is never more than 50
|
||||||
-[x] "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;
|
-[x] "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 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
|
-[ ] Quality drops to 0 after the concert
|
||||||
-[ ] an item can never have its Quality increase above 50, however "Sulfuras" is a legendary item and as such its Quality is 80 and it never alters.
|
-[ ] an item can never have its Quality increase above 50, however "Sulfuras" is a legendary item and as such its Quality is 80 and it never alters.
|
||||||
|
|||||||
@ -91,7 +91,7 @@ public class GildedRoseTest {
|
|||||||
//Sulfuras, Hand of Ragnaros
|
//Sulfuras, Hand of Ragnaros
|
||||||
@Test
|
@Test
|
||||||
@DisplayName("\"Sulfuras\", being a legendary item, never has to be sold or decreases in Quality")
|
@DisplayName("\"Sulfuras\", being a legendary item, never has to be sold or decreases in Quality")
|
||||||
public void should(){
|
public void shouldNotChangeSulfurasSellInAndQualityValues(){
|
||||||
Item[] items = new Item[]{TestHelper.getItem("Sulfuras, Hand of Ragnaros", 0, 10)};
|
Item[] items = new Item[]{TestHelper.getItem("Sulfuras, Hand of Ragnaros", 0, 10)};
|
||||||
GildedRose app = new GildedRose(items);
|
GildedRose app = new GildedRose(items);
|
||||||
|
|
||||||
@ -106,4 +106,21 @@ public class GildedRoseTest {
|
|||||||
assertEquals(0, app.items[0].sellIn);
|
assertEquals(0, app.items[0].sellIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("\"Backstage passes\", like aged brie, increases in Quality as its SellIn value approaches")
|
||||||
|
public void shouldDo(){
|
||||||
|
Item[] items = new Item[]{TestHelper.getItem("Backstage passes to a TAFKAL80ETC concert", 5, 10)};
|
||||||
|
GildedRose app = new GildedRose(items);
|
||||||
|
|
||||||
|
//day 1, increase by 3 the quality
|
||||||
|
app.updateQuality();
|
||||||
|
assertEquals(13, app.items[0].quality);
|
||||||
|
assertEquals(4, app.items[0].sellIn);
|
||||||
|
|
||||||
|
//day 1, increase by 3 the quality
|
||||||
|
app.updateQuality();
|
||||||
|
assertEquals(16, app.items[0].quality);
|
||||||
|
assertEquals(3, app.items[0].sellIn);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user