mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-21 01:11:08 +00:00
quality limites
This commit is contained in:
parent
6147b678a3
commit
220b20237a
@ -18,7 +18,8 @@
|
|||||||
-[x] "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;
|
||||||
-[x] Quality increases by 2 when there are 10 days or less and by 3 when there are 5 days or less but
|
-[x] Quality increases by 2 when there are 10 days or less and by 3 when there are 5 days or less but
|
||||||
-[x] Quality drops to 0 after the concert
|
-[x] 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.
|
||||||
|
|
||||||
## Technical Issues, with a balanced priority
|
## Technical Issues, with a balanced priority
|
||||||
-[ ]
|
-[ ]
|
||||||
|
|||||||
@ -159,5 +159,37 @@ public class GildedRoseTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@DisplayName("Quality limits for")
|
||||||
|
class QualityBound{
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("an item can never have its Quality increase above 50")
|
||||||
|
public void shouldNeverHaveQualityAbove50(){
|
||||||
|
Item[] items = new Item[]{
|
||||||
|
TestHelper.getItem("Backstage passes to a TAFKAL80ETC concert", 10, 49)
|
||||||
|
};
|
||||||
|
|
||||||
|
GildedRose app = new GildedRose(items);
|
||||||
|
|
||||||
|
app.updateQuality();
|
||||||
|
assertEquals(50, app.items[0].quality);
|
||||||
|
assertEquals(9, app.items[0].sellIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("however \"Sulfuras\" is a legendary item and as such its Quality is 80 and it never alters")
|
||||||
|
public void shouldSulfurasNeverAltersForSulfuras(){
|
||||||
|
Item[] items = new Item[]{
|
||||||
|
TestHelper.getItem("Sulfuras, Hand of Ragnaros", 10, 80)
|
||||||
|
};
|
||||||
|
|
||||||
|
GildedRose app = new GildedRose(items);
|
||||||
|
|
||||||
|
app.updateQuality();
|
||||||
|
assertEquals(80, app.items[0].quality);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user