diff --git a/Kotlin/src/main/kotlin/com/gildedrose/Item.kt b/Kotlin/src/main/kotlin/com/gildedrose/Item.kt deleted file mode 100644 index 418397f2..00000000 --- a/Kotlin/src/main/kotlin/com/gildedrose/Item.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.gildedrose - -//Check git works -//open class Item(var name: String, var sellIn: Int, var quality: Int) { -// override fun toString(): String { -// return this.name + ", " + this.sellIn + ", " + this.quality -// } -//} - -data class Item(var name: String, var sellIn: Int, var quality: Int) diff --git a/Kotlin/src/main/kotlin/com/gildedrose/TexttestFixture.kt b/Kotlin/src/main/kotlin/com/gildedrose/TexttestFixture.kt index 57c95ca5..2dacca6c 100644 --- a/Kotlin/src/main/kotlin/com/gildedrose/TexttestFixture.kt +++ b/Kotlin/src/main/kotlin/com/gildedrose/TexttestFixture.kt @@ -1,19 +1,7 @@ package com.gildedrose -object ItemRepository { - 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), // - Item("Sulfuras, Hand of Ragnaros", -1, 80), - Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), - Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), - Item("Backstage passes to a TAFKAL80ETC concert", 5, 49), - // this conjured item does not work properly yet - Item("Conjured Mana Cake", 3, 6) - ) -} +import com.gildedrose.data.constants.ItemRepository + //asd fun main(args: Array) { diff --git a/Kotlin/src/main/kotlin/com/gildedrose/data/constants/ItemRepository.kt b/Kotlin/src/main/kotlin/com/gildedrose/data/constants/ItemRepository.kt new file mode 100644 index 00000000..55a18ba3 --- /dev/null +++ b/Kotlin/src/main/kotlin/com/gildedrose/data/constants/ItemRepository.kt @@ -0,0 +1,18 @@ +package com.gildedrose.data.constants + +import com.gildedrose.data.model.Item + +object ItemRepository { + 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), // + Item("Sulfuras, Hand of Ragnaros", -1, 80), + Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), + Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), + Item("Backstage passes to a TAFKAL80ETC concert", 5, 49), + // this conjured item does not work properly yet + Item("Conjured Mana Cake", 3, 6) + ) +} \ No newline at end of file diff --git a/Kotlin/src/main/kotlin/com/gildedrose/data/model/Item.kt b/Kotlin/src/main/kotlin/com/gildedrose/data/model/Item.kt new file mode 100644 index 00000000..1c84f5a3 --- /dev/null +++ b/Kotlin/src/main/kotlin/com/gildedrose/data/model/Item.kt @@ -0,0 +1,3 @@ +package com.gildedrose.data.model + +data class Item(var name: String, var sellIn: Int, var quality: Int) \ No newline at end of file diff --git a/Kotlin/src/test/kotlin/com/gildedrose/GildedRoseTest.kt b/Kotlin/src/test/kotlin/com/gildedrose/GildedRoseTest.kt index c5216d8a..0f9aacba 100644 --- a/Kotlin/src/test/kotlin/com/gildedrose/GildedRoseTest.kt +++ b/Kotlin/src/test/kotlin/com/gildedrose/GildedRoseTest.kt @@ -1,5 +1,6 @@ package com.gildedrose +import com.gildedrose.data.model.Item import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test