Java version of the kata now compiles and has a failing test

This commit is contained in:
Emily Bache 2012-01-12 21:55:28 +01:00
parent e8e5e0223f
commit a43bfe0f0d
3 changed files with 25 additions and 5 deletions

View File

@ -1,18 +1,22 @@
class GildedRose {
List<Item> items;
Item[] items;
public static void Main(string[] args) {
public GildedRose(Item[] items) {
this.items = items;
}
public static void main(String[] args) {
System.out.println("OMGHAI!");
List<Item> items = new List<Item> {
Item[] items = new 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("Backstage passes to a TAFKAL80ETC concert", 15, 20),
new Item("Conjured Mana Cake", 3, 6)
}
};
GildedRose app = new GildedRose(items);

View File

@ -0,0 +1,16 @@
import static org.junit.Assert.*;
import org.junit.Test;
public class GildedRoseTest {
@Test
public void foo() {
Item[] items = new Item[] {
new Item("foo", 0, 0)
};
GildedRose app = new GildedRose(items);
app.updateQuality();
assertEquals("fixme", app.items[0].name);
}
}