diff --git a/test/test_timequiz.c b/test/test_timequiz.c index a24b0df..b7f9378 100644 --- a/test/test_timequiz.c +++ b/test/test_timequiz.c @@ -86,4 +86,15 @@ void test_processUserAnswer_correctAnswer_index0(void) { TEST_ASSERT_EQUAL_INT(1, totalCorrectAnswers); } +void test_processUserAnswer_wrongAnswer_index3(void) { + int score = 0; + int totalCorrectAnswers = 0; + char* answers[] = {"Paris", "London", "Berlin", "Madrid"}; + int correctIndex = 0; + int userAnswer = 4; // Assuming user selects the fourth option + processUserAnswer(userAnswer, correctIndex, &score, &totalCorrectAnswers, answers); + TEST_ASSERT_EQUAL_INT(0, score); + TEST_ASSERT_EQUAL_INT(0, totalCorrectAnswers); +} + #endif //TEST