|
@ -16,7 +16,7 @@ void test_items(void) |
|
|
{ |
|
|
{ |
|
|
/* arrange */ |
|
|
/* arrange */ |
|
|
// Hier die Werte eingeben/deklarieren |
|
|
// Hier die Werte eingeben/deklarieren |
|
|
Item* items; |
|
|
|
|
|
|
|
|
Item *items; |
|
|
int expectedItemID = 1; |
|
|
int expectedItemID = 1; |
|
|
int expectedSecondItemID = 2; |
|
|
int expectedSecondItemID = 2; |
|
|
|
|
|
|
|
@ -25,7 +25,8 @@ void test_items(void) |
|
|
items = getItems("./src/content/items.map"); |
|
|
items = getItems("./src/content/items.map"); |
|
|
|
|
|
|
|
|
/* make visible OUTPUT */ |
|
|
/* make visible OUTPUT */ |
|
|
for(int i=0; i<4;i++){ |
|
|
|
|
|
|
|
|
for (int i = 0; i < 4; i++) |
|
|
|
|
|
{ |
|
|
printf("%s\n", items[i].itemName); |
|
|
printf("%s\n", items[i].itemName); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -35,4 +36,21 @@ void test_items(void) |
|
|
TEST_ASSERT_EQUAL_INT(expectedSecondItemID, items[1].id); |
|
|
TEST_ASSERT_EQUAL_INT(expectedSecondItemID, items[1].id); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_setItemPrice(void) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
// arrange |
|
|
|
|
|
int price = 50, result; |
|
|
|
|
|
// act |
|
|
|
|
|
Item test; |
|
|
|
|
|
setItemPrice(&test, price); |
|
|
|
|
|
result = test.price; |
|
|
|
|
|
|
|
|
|
|
|
printf("---------------------------------------------------\n"); |
|
|
|
|
|
printf("setItemPrice | price to set: %d -> item.price: %d", price, result); |
|
|
|
|
|
|
|
|
|
|
|
// assert |
|
|
|
|
|
TEST_ASSERT_EQUAL(price, result); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
#endif // TEST |
|
|
#endif // TEST |