diff --git a/Java/README.md b/Java/README.md index c82c421f..94084b9e 100644 --- a/Java/README.md +++ b/Java/README.md @@ -18,7 +18,8 @@ -[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 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 -[ ] diff --git a/Java/src/test/java/com/gildedrose/GildedRoseTest.java b/Java/src/test/java/com/gildedrose/GildedRoseTest.java index 2ec1d3de..f684d5b6 100644 --- a/Java/src/test/java/com/gildedrose/GildedRoseTest.java +++ b/Java/src/test/java/com/gildedrose/GildedRoseTest.java @@ -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); + } + } + } \ No newline at end of file