From b7f63143af5d2554469557d92498d34601efabb1 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Mon, 24 Jun 2019 07:12:36 +0200 Subject: [PATCH] test: "Sulfuras", being a legendary item, never has to be sold or decreases in Quality --- .../java/com/gildedrose/GildedRoseTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Java/src/test/java/com/gildedrose/GildedRoseTest.java b/Java/src/test/java/com/gildedrose/GildedRoseTest.java index cc2a23b8..2ffdb63a 100644 --- a/Java/src/test/java/com/gildedrose/GildedRoseTest.java +++ b/Java/src/test/java/com/gildedrose/GildedRoseTest.java @@ -58,6 +58,23 @@ class GildedRoseTest { assertItem(item, "foo", -2, initialQuality - 2); } + @Feature("\"Sulfuras\", being a legendary item, never has to be sold or decreases in Quality") + @Test + void shouldTheNotChangeSulfuras() { + // given + val initialQuality = nextInt(70, 90); + val initialSellIn = nextInt(3, 50); + val itemName = "Sulfuras, Hand of Ragnaros"; + GildedRose app = prepareApp(new Item(itemName, initialSellIn, initialQuality)); + + // when + app.updateQuality(); + + // then + final Item item = app.items[0]; + assertItem(item, itemName, initialSellIn, initialQuality); + } + @Feature("\"Aged Brie\" actually increases in Quality the older it gets") @Feature("The Quality of an item is never more than 50") @ParameterizedTest(name = "Initial quality: {arguments}")