mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
test: The Quality of an item is never more than 50
This commit is contained in:
parent
8445af69a4
commit
fe2a19749b
@ -8,6 +8,7 @@ import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
||||
import static com.gildedrose.TestHelper.assertItem;
|
||||
import static com.gildedrose.TestHelper.prepareApp;
|
||||
import static java.lang.Math.min;
|
||||
import static org.apache.commons.lang3.RandomUtils.nextInt;
|
||||
|
||||
|
||||
@ -58,8 +59,9 @@ class GildedRoseTest {
|
||||
}
|
||||
|
||||
@Feature("\"Aged Brie\" actually increases in Quality the older it gets")
|
||||
@Feature("The Quality of an item is never more than 50")
|
||||
@ParameterizedTest(name = "Initial quality: {arguments}")
|
||||
@ValueSource(ints = {0, 1, 49})
|
||||
@ValueSource(ints = {0, 1, 49, 50})
|
||||
void shouldIncreaseQualityForAgedBrie(int initialQuality) {
|
||||
// given
|
||||
GildedRose app = prepareApp(new Item("Aged Brie", 1, initialQuality));
|
||||
@ -69,6 +71,7 @@ class GildedRoseTest {
|
||||
|
||||
// then
|
||||
final Item item = app.items[0];
|
||||
assertItem(item, "Aged Brie", 0, initialQuality + 1);
|
||||
final int expectedQuality = min(initialQuality + 1, 50);
|
||||
assertItem(item, "Aged Brie", 0, expectedQuality);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user