mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 06:51:27 +00:00
test; adding a new test cases
This commit is contained in:
parent
c68e0b3dcd
commit
f6f99c1cef
@ -69,8 +69,8 @@ class UpdateQualityTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void sellInValueCanBeNegative() {
|
||||
System.out.println("SellIn value of an Item can be negative until quality reach zero");
|
||||
void sellInValueCanBeNegativeStartAtZero() {
|
||||
System.out.println("SellIn value of an Item can be negative until quality reach zero: start with a zero sellin Value");
|
||||
Item[] items = new Item[]{new Item("+5 Dexterity Vest", 0, 30)};
|
||||
GildedRose app = new GildedRose(items);
|
||||
int timeFrame = 10;
|
||||
@ -81,6 +81,19 @@ class UpdateQualityTest {
|
||||
assertEquals(-timeFrame, app.items[0].sellIn);
|
||||
}
|
||||
|
||||
@Test
|
||||
void sellInValueCanBeNegativeStartNegativeSellInValue() {
|
||||
System.out.println("SellIn value of an Item can be until quality reach zero: start with a negative sellinValue");
|
||||
Item[] items = new Item[]{new Item("+5 Dexterity Vest", -5, 30)};
|
||||
GildedRose app = new GildedRose(items);
|
||||
int timeFrame = 10;
|
||||
for (int i = 0; i < timeFrame; i++) {
|
||||
app.updateQuality();
|
||||
}
|
||||
assertEquals(10, app.items[0].quality);
|
||||
assertEquals(-5 -timeFrame, app.items[0].sellIn);
|
||||
}
|
||||
|
||||
@Test
|
||||
void sellInValueCanNotChangeForSulfuras() {
|
||||
System.out.println("SellIn value of Sulfuras Item can not change");
|
||||
@ -207,7 +220,7 @@ class UpdateQualityTest {
|
||||
};
|
||||
GildedRose app = new GildedRose(items);
|
||||
app.updateQuality();
|
||||
assertEquals(0, app.items[0].quality);
|
||||
assertEquals(0, app.items[0].quality);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user