add TexttestFixture.scala

This commit is contained in:
Anh-Vu Tran 2018-07-15 14:31:04 +02:00
parent a8845b5459
commit 42a05d6cdd
2 changed files with 30 additions and 1 deletions

View File

@ -1 +1 @@
sbt.version=0.13.13 sbt.version=1.1.6

View File

@ -0,0 +1,29 @@
package com.gildedrose
object TexttestFixture {
def main(args: Array[String]): Unit = {
var items = Array[Item](
new Item("+5 Dexterity Vest", 10, 20),
new Item("Aged Brie", 2, 0),
new Item("Elixir of the Mongoose", 5, 7),
new Item("Sulfuras, Hand of Ragnaros", 0, 80),
new Item("Sulfuras, Hand of Ragnaros", -1, 80),
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
// this conjured item does not work properly yet
new Item("Conjured Mana Cake", 3, 6)
)
val app = new GildedRose(items)
val days = if (args.length > 0) args(0).toInt + 1 else 2
for (i <- 0 until days) {
System.out.println("-------- day " + i + " --------")
System.out.println("name, sellIn, quality")
for (item <- items) {
System.out.println(item.name + ", " + item.sellIn + ", " + item.quality)
}
System.out.println()
app.updateQuality()
}
}
}