format Java code (only whitespace changes)

This commit is contained in:
Peter Kofler 2013-10-22 20:52:36 +02:00
parent 75a2a15f14
commit 7c817b1032
4 changed files with 136 additions and 131 deletions

1
Java/com/gildedrose/GildedRose.java Executable file → Normal file
View File

@ -1,4 +1,5 @@
package com.gildedrose; package com.gildedrose;
class GildedRose { class GildedRose {
Item[] items; Item[] items;

View File

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

1
Java/com/gildedrose/Item.java Executable file → Normal file
View File

@ -1,4 +1,5 @@
package com.gildedrose; package com.gildedrose;
public class Item { public class Item {
public String name; public String name;

29
Java/com/gildedrose/TexttestFixture.java Executable file → Normal file
View File

@ -2,20 +2,21 @@ package com.gildedrose;
public class TexttestFixture { public class TexttestFixture {
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("OMGHAI!"); System.out.println("OMGHAI!");
Item[] items = new Item[] { new Item("+5 Dexterity Vest", 10, 20), Item[] items = new Item[] {
new Item("Aged Brie", 2, 0), new Item("+5 Dexterity Vest", 10, 20), //
new Item("Elixir of the Mongoose", 5, 7), new Item("Aged Brie", 2, 0), //
new Item("Sulfuras, Hand of Ragnaros", 0, 80), new Item("Elixir of the Mongoose", 5, 7), //
new Item("Sulfuras, Hand of Ragnaros", -1, 80), new Item("Sulfuras, Hand of Ragnaros", 0, 80), //
new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), new Item("Sulfuras, Hand of Ragnaros", -1, 80),
new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20),
new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49), new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49),
// this conjured item does not work properly yet new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49),
new Item("Conjured Mana Cake", 3, 6) }; // this conjured item does not work properly yet
new Item("Conjured Mana Cake", 3, 6) };
GildedRose app = new GildedRose(items); GildedRose app = new GildedRose(items);
int days = 2; int days = 2;
if (args.length > 0) { if (args.length > 0) {
@ -29,8 +30,8 @@ public class TexttestFixture {
System.out.println(item); System.out.println(item);
} }
System.out.println(); System.out.println();
app.updateQuality(); app.updateQuality();
} }
} }
} }