Added test for zero

This commit is contained in:
Clay Dowling committed 2017-03-10 21:53:40 -05:00
1 parent 38857a8dc9
commit 19dcacbf7e
1 file changed
+11
+11
View File
@@ -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;
}