Added tests for backstage pass

This commit is contained in:
Clay Dowling committed 2017-03-10 22:26:15 -05:00
1 parent 19dcacbf7e
commit ceebe400c9
2 files changed
+39

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
#include <check.h>
#include "GildedRose.h"
#define GOOD_BACKSTAGE "Backstage passes to a TAFKAL80ETC concert"
#define BAD_BACKSTAGE "Backstage passes to a Jeff Beck concert"
START_TEST(backstage_whenMoreThan10Days_increasesByOne)
{
Item items[1];
init_item(items, GOOD_BACKSTAGE, 12, 15);
update_quality(items, 1);
ck_assert_int_eq(16, items[0].quality);
}
END_TEST
START_TEST(backstage_when10Days_increasesByTwo)
{
Item items[1];
init_item(items, GOOD_BACKSTAGE, 10, 15);
update_quality(items, 1);
ck_assert_int_eq(17, items[0].quality);
}
END_TEST
TCase *tcase_backstage(void)
{
TCase *tc;
tc = tcase_create("backstage-pass");
tcase_add_test(tc, backstage_whenMoreThan10Days_increasesByOne);
tcase_add_test(tc, backstage_when10Days_increasesByTwo);
return tc;
}
+2
View File
@@ -4,6 +4,7 @@
#define NORMAL_ITEM "Elixer of Mongoose"
TCase *tcase_brie(void);
TCase *tcase_backstage(void);
START_TEST(normalitem_whenSellInPositive_decreasesQualityByOne)
{
@@ -77,6 +78,7 @@ Suite *suite_normal(void)
s = suite_create("characterization-tests");
suite_add_tcase(s, tcase_normal());
suite_add_tcase(s, tcase_brie());
suite_add_tcase(s, tcase_backstage());
return s;
}