mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
Add test when when item is Backstage and sellIn is less than 6 and quality is less than 48 then should increase in 3 quality and decrease sellIn in 1
This commit is contained in:
parent
fb09349e7d
commit
a1e14123b8
@ -32,7 +32,7 @@ class GildedRoseShould {
|
||||
}
|
||||
|
||||
@Test
|
||||
void decrease_sellIn_and_decrease_quality_when_item_name_is_AgedBrie_and_quality_is_40() {
|
||||
void decrease_sellIn_and_increase_quality_when_item_name_is_AgedBrie_and_quality_is_40() {
|
||||
Item[] items = {new Item("Aged Brie", 10, 40)};
|
||||
GildedRose gildedRose = new GildedRose(items);
|
||||
|
||||
@ -42,6 +42,15 @@ class GildedRoseShould {
|
||||
assertEquals(41, gildedRose.items[0].quality);
|
||||
}
|
||||
|
||||
@Test
|
||||
void when_item_is_Backstage_and_sellIn_is_less_than_6_and_quality_is_less_than_48_then_should_increase_in_3_quality_and_decrease_sellIn_in_1() {
|
||||
Item[] items = {new Item("Backstage passes to a TAFKAL80ETC concert", 5, 47)};
|
||||
GildedRose gildedRose = new GildedRose(items);
|
||||
|
||||
gildedRose.updateQuality();
|
||||
|
||||
assertEquals(4, gildedRose.items[0].sellIn);
|
||||
assertEquals(50, gildedRose.items[0].quality);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user