|
|
@ -18,4 +18,28 @@ void test_erstelleFrage(void) { |
|
|
|
TEST_ASSERT_EQUAL_STRING("AntwortD", testFrage.antwortD); |
|
|
|
TEST_ASSERT_EQUAL_CHAR('A', testFrage.korrekteAntwort); |
|
|
|
} |
|
|
|
|
|
|
|
void test_CookingFragen(void) { |
|
|
|
Kategorie kategorien[MAX_CATEGORIES]; |
|
|
|
|
|
|
|
kategorien[1].fragen = (QuizFrage*)malloc(MAX_QUESTIONS_PER_CATEGORY * sizeof(QuizFrage)); |
|
|
|
|
|
|
|
kategorien[1].fragen[0] = erstelleFrage("Which Ingredient is used traditionally for Pesto?", "Tomatoes", "Basil", "Spinach", "Oregano", 'B'); |
|
|
|
kategorien[1].fragen[1] = erstelleFrage("Which meal is known for its usage of rice?", "Lasagna", "Sushi", "Pizza", "Hamburger", 'B'); |
|
|
|
kategorien[1].fragen[2] = erstelleFrage("Which color has a ripe banana?", "Red", "Green", "Yellow", "Orange", 'C'); |
|
|
|
|
|
|
|
kategorien[1].anzahlFragen = MAX_QUESTIONS_PER_CATEGORY; |
|
|
|
kategorien[1].joker = 1; |
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_STRING("Which Ingredient is used traditionally for Pesto?", kategorien[1].fragen[0].frage); |
|
|
|
TEST_ASSERT_EQUAL_STRING("Tomatoes", kategorien[1].fragen[0].antwortA); |
|
|
|
TEST_ASSERT_EQUAL_STRING("Basil", kategorien[1].fragen[0].antwortB); |
|
|
|
TEST_ASSERT_EQUAL_STRING("Spinach", kategorien[1].fragen[0].antwortC); |
|
|
|
TEST_ASSERT_EQUAL_STRING("Oregano", kategorien[1].fragen[0].antwortD); |
|
|
|
TEST_ASSERT_EQUAL_CHAR('B', kategorien[1].fragen[0].korrekteAntwort); |
|
|
|
|
|
|
|
|
|
|
|
free(kategorien[1].fragen); |
|
|
|
} |
|
|
|
|
|
|
|
#endif //TEST |