mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-18 16:01:42 +00:00
Quality is never more than 50 (except Sulfuras).
This commit is contained in:
parent
b8badc7ed9
commit
ce81b8bb03
@ -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
|
@Test
|
||||||
fun ordinaryItemsDecreaseInSellIn() {
|
fun ordinaryItemsDecreaseInSellIn() {
|
||||||
val elixir = gildedRose.items.first { it.name.startsWith("Elixir") }
|
val elixir = gildedRose.items.first { it.name.startsWith("Elixir") }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user