mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 15:01:28 +00:00
Add remaining quality tests
This commit is contained in:
parent
68df724e4d
commit
f137b02051
@ -117,4 +117,28 @@ class GildedRoseTest {
|
|||||||
app.updateQuality();
|
app.updateQuality();
|
||||||
assertEquals(app.items[0].quality, 50);
|
assertEquals(app.items[0].quality, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void qualityDecreasesByOneEachDayForGenericItems() {
|
||||||
|
Item[] items = new Item[] { new Item("generic item", 5, 5) };
|
||||||
|
GildedRose app = new GildedRose(items);
|
||||||
|
app.updateQuality();
|
||||||
|
assertEquals(app.items[0].quality, 4);
|
||||||
|
app.updateQuality();
|
||||||
|
assertEquals(app.items[0].quality, 3);
|
||||||
|
app.updateQuality();
|
||||||
|
assertEquals(app.items[0].quality, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void qualityDecreasesByTwoEachDayForGenericItemsAfterSellInDate() {
|
||||||
|
Item[] items = new Item[] { new Item("generic item", 1, 6) };
|
||||||
|
GildedRose app = new GildedRose(items);
|
||||||
|
app.updateQuality();
|
||||||
|
assertEquals(app.items[0].quality, 5);
|
||||||
|
app.updateQuality();
|
||||||
|
assertEquals(app.items[0].quality, 3);
|
||||||
|
app.updateQuality();
|
||||||
|
assertEquals(app.items[0].quality, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user