mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 12:22:12 +00:00
Java version of the kata now compiles and has a failing test
This commit is contained in:
parent
e8e5e0223f
commit
a43bfe0f0d
@ -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);
|
||||
|
||||
|
||||
16
GildedRose/Java/GildedRoseTest.java
Normal file
16
GildedRose/Java/GildedRoseTest.java
Normal 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);
|
||||
}
|
||||
}
|
||||
2
README
2
README
@ -3,4 +3,4 @@ This is a collection of starting files for when practicing refactoring.
|
||||
Contents so far:
|
||||
|
||||
Tennis Kata in Java, Python and C++.
|
||||
GildedRose Kata in Java, Python and C++. (a C# version is already available on github)
|
||||
Gilded Rose Kata in Java, Python and C++. (a C# version is already available on github)
|
||||
Loading…
Reference in New Issue
Block a user