mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 20:32:15 +00:00
add TexttestFixture.scala
This commit is contained in:
parent
a8845b5459
commit
42a05d6cdd
@ -1 +1 @@
|
|||||||
sbt.version=0.13.13
|
sbt.version=1.1.6
|
||||||
|
|||||||
29
scala/src/test/scala/com/gildedrose/TexttestFixture.scala
Normal file
29
scala/src/test/scala/com/gildedrose/TexttestFixture.scala
Normal 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()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user