mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-16 19:05:05 +00:00
Use gradle to build kotlin files
Use `gradle test` to run the unit tests.
This commit is contained in:
1 parent
6f972d0c5f
commit
b6a54f72b5
11 files changed
+318
-22
No files matched your search
@@ -0,0 +1,19 @@
|
||||
package com.gildedrose
|
||||
|
||||
import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
|
||||
class GildedRoseTest {
|
||||
|
||||
@Test fun foo() {
|
||||
val items = arrayOf<Item>(Item("foo", 0, 0))
|
||||
val app = GildedRose(items)
|
||||
app.updateQuality()
|
||||
assertEquals("fixme", app.items[0].name)
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.gildedrose
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
|
||||
println("OMGHAI!")
|
||||
|
||||
val items = arrayOf(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))
|
||||
|
||||
val app = GildedRose(items)
|
||||
|
||||
var days = 2
|
||||
if (args.size > 0) {
|
||||
days = Integer.parseInt(args[0]) + 1
|
||||
}
|
||||
|
||||
for (i in 0..days - 1) {
|
||||
println("-------- day $i --------")
|
||||
println("name, sellIn, quality")
|
||||
for (item in items) {
|
||||
println(item)
|
||||
}
|
||||
println()
|
||||
app.updateQuality()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user