mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 12:22:12 +00:00
Added test for zero
This commit is contained in:
parent
38857a8dc9
commit
19dcacbf7e
@ -46,6 +46,16 @@ START_TEST(normalitem_whenSellInNegative_decreasesByTwo)
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(normalitem_whenSellInZero_decreasesByTwo)
|
||||
{
|
||||
Item items[1];
|
||||
init_item(items, NORMAL_ITEM, -1, 15);
|
||||
update_quality(items, 1);
|
||||
|
||||
ck_assert_int_eq(13, items[0].quality);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
TCase *tcase_normal(void)
|
||||
{
|
||||
TCase *tc;
|
||||
@ -55,6 +65,7 @@ TCase *tcase_normal(void)
|
||||
tcase_add_test(tc, normalitem_whenSellIsZero_decreasesQualityByTwo);
|
||||
tcase_add_test(tc, normalitem_whenQualityZero_doesNotDecrease);
|
||||
tcase_add_test(tc, normalitem_whenSellInNegative_decreasesByTwo);
|
||||
tcase_add_test(tc, normalitem_whenSellInZero_decreasesByTwo);
|
||||
|
||||
return tc;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user