Skip to content

Instantly share code, notes, and snippets.

@GeePawHill
Created September 22, 2022 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GeePawHill/4ccd8718129723be636e324808f54682 to your computer and use it in GitHub Desktop.
Save GeePawHill/4ccd8718129723be636e324808f54682 to your computer and use it in GitHub Desktop.
Second rework of test.
@Test
fun `sulfuras never changes`() {
val item = updateQuality(Item(SULFURUS_NAME, Int.MAX_VALUE, 80))
with(item) {
assertThat(name).isEqualTo(SULFURUS_NAME)
assertThat(sellIn).isEqualTo(Int.MAX_VALUE)
assertThat(quality).isEqualTo(80)
}
}
fun updateQuality(item:Item):Item {
val items = arrayOf(item)
val app = GildedRose(items)
app.updateQuality()
return app.items[0]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment