mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 20:32:15 +00:00
Merge pull request #417 from dmcg/master
Update versions in Kotlin variant, and use List rather than Array
This commit is contained in:
commit
227729512d
@ -1,7 +1,7 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
kotlin("jvm") version "1.6.10"
|
||||
kotlin("jvm") version "1.8.10"
|
||||
}
|
||||
|
||||
group = "com.gildedrose"
|
||||
@ -13,7 +13,7 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib"))
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.gildedrose
|
||||
|
||||
class GildedRose(var items: Array<Item>) {
|
||||
class GildedRose(var items: List<Item>) {
|
||||
|
||||
fun updateQuality() {
|
||||
for (i in items.indices) {
|
||||
|
||||
@ -7,7 +7,7 @@ internal class GildedRoseTest {
|
||||
|
||||
@Test
|
||||
fun foo() {
|
||||
val items = arrayOf<Item>(Item("foo", 0, 0))
|
||||
val items = listOf(Item("foo", 0, 0))
|
||||
val app = GildedRose(items)
|
||||
app.updateQuality()
|
||||
assertEquals("fixme", app.items[0].name)
|
||||
|
||||
@ -4,7 +4,7 @@ fun main(args: Array<String>) {
|
||||
|
||||
println("OMGHAI!")
|
||||
|
||||
val items = arrayOf(Item("+5 Dexterity Vest", 10, 20), //
|
||||
val items = listOf(Item("+5 Dexterity Vest", 10, 20), //
|
||||
Item("Aged Brie", 2, 0), //
|
||||
Item("Elixir of the Mongoose", 5, 7), //
|
||||
Item("Sulfuras, Hand of Ragnaros", 0, 80), //
|
||||
@ -31,6 +31,4 @@ fun main(args: Array<String>) {
|
||||
println()
|
||||
app.updateQuality()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user