Quality is never more than 50 (except Sulfuras).

This commit is contained in:
Eric Jan Malotaux 2022-04-27 00:07:00 +02:00
parent b8badc7ed9
commit ce81b8bb03

View File

@ -47,6 +47,20 @@ internal class GildedRoseTest {
}
}
@Test
fun qualityIsNeverMoreThanFifty() {
(items.map { it.sellIn }.maxOrNull()!! downTo -3).forEach {
gildedRose.updateQuality()
assertFalse(
items
.filterNot { it.name.startsWith("Sulfuras") }
.map { it.quality }
.maxOrNull()!!
> 50
)
}
}
@Test
fun ordinaryItemsDecreaseInSellIn() {
val elixir = gildedRose.items.first { it.name.startsWith("Elixir") }