mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-19 16:31:30 +00:00
Add test for increasing negative quality edge case
Quality can never be lower than 0. So increasing a negative quality should always result in a quality bigger than 0
This commit is contained in:
parent
7e3e5d0d7c
commit
e68fab24b4
@ -39,6 +39,14 @@ public class IncreasingQualityBehaviorTest {
|
|||||||
assertEquals(50, item.quality);
|
assertEquals(50, item.quality);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void increaseNegativeQuality() {
|
||||||
|
Item item = getItem(-10);
|
||||||
|
qualityBehavior.processQualityUpdate(item);
|
||||||
|
|
||||||
|
assertEquals(0, item.quality);
|
||||||
|
}
|
||||||
|
|
||||||
private Item getItem(int quality) {
|
private Item getItem(int quality) {
|
||||||
return new Item("SomeItem", 0, quality);
|
return new Item("SomeItem", 0, quality);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user