mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 06:21:29 +00:00
The Quality of an item is never more than 50
This commit is contained in:
parent
2a0ab58f8c
commit
2de3baa6b3
@ -12,8 +12,8 @@
|
||||
-[x] At the end of each day our system lowers both values for every item
|
||||
-[x] Once the sell by date has passed, Quality degrades twice as fast
|
||||
-[x] The Quality of an item is never negative
|
||||
-[ ] "Aged Brie" actually increases in Quality the older it gets
|
||||
-[ ] The Quality of an item is never more than 50
|
||||
-[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
|
||||
-[ ] "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
|
||||
|
||||
@ -73,4 +73,19 @@ public class GildedRoseTest {
|
||||
assertEquals(4, app.items[0].quality);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("The Quality of an item is never more than 50")
|
||||
public void shouldNeverHaveQualityHigherThan50(){
|
||||
Item[] items = new Item[]{TestHelper.getItem("Aged Brie", 0, 49)};
|
||||
GildedRose app = new GildedRose(items);
|
||||
|
||||
//day 1, add 2
|
||||
app.updateQuality();
|
||||
assertEquals(50, app.items[0].quality);
|
||||
|
||||
//day 2, add 2
|
||||
app.updateQuality();
|
||||
assertEquals(50, app.items[0].quality);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user