Added Gradle to Groovy project.

This commit is contained in:
Mike Vitale committed 2022-08-26 13:51:13 -05:00
1 parent bc7de77181
commit b3d0da2a9a
10 files changed
+437 -176

No files matched your search

@@ -0,0 +1,15 @@
package com.gildedrose
import org.junit.jupiter.api.Test
class GildedRoseTest {
@Test
void "foo"() {
def items = [ new Item("foo", 0, 0) ] as Item[]
def app = new GildedRose(items)
app.updateQuality()
assert "fixme" == app.items[0].name
}
}
@@ -0,0 +1,32 @@
package com.gildedrose
println("OMGHAI!")
Item[] items = [
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)] as Item[]
GildedRose app = new GildedRose(items)
int days = 2
if (args.length > 0) {
days = Integer.parseInt(args[0]) + 1
}
for (int i = 0; i < days; i++) {
println("-------- day " + i + " --------")
println("name, sellIn, quality")
for (Item item in items) {
println(item)
}
println ""
app.updateQuality()
}