- Increase project information in README.md

- First test refactor
This commit is contained in:
Luciano Minuzzi 2020-05-02 19:29:21 +02:00
parent 9582cc4a6a
commit 6c7e1f4b06

View File

@ -2,16 +2,28 @@ package com.gildedrose;
import org.junit.jupiter.api.Test;
import java.util.stream.IntStream;
import static org.junit.jupiter.api.Assertions.assertEquals;
class GildedRoseTest {
@Test
void foo() {
Item[] items = new Item[] { new Item("foo", 0, 0) };
void dexterityVestShouldDecreaseSellInAndQualityEachUpdate() {
String name = "+5 Dexterity Vest";
int sellIn = 10;
int quality = 20;
int days = 2;
Item[] items = new Item[]{new Item(name, sellIn, quality)};
GildedRose app = new GildedRose(items);
app.updateQuality();
assertEquals("fixme", app.items[0].name);
IntStream.rangeClosed(1, days).forEach(index -> {
app.updateQuality();
assertEquals(name, app.items[0].name);
assertEquals(sellIn - index, app.items[0].sellIn);
assertEquals(quality - index, app.items[0].quality);
});
}
}