From c75c552687da72c19fd6ac48a21c41e33d9b91d6 Mon Sep 17 00:00:00 2001 From: Pascal Schneider Date: Tue, 6 Feb 2024 00:05:44 +0100 Subject: [PATCH] 6. Unittest --- test/test_timequiz.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test_timequiz.c b/test/test_timequiz.c index b42386a..a24b0df 100644 --- a/test/test_timequiz.c +++ b/test/test_timequiz.c @@ -77,5 +77,13 @@ void test_processUserAnswer_correctAnswer_index3(void) { TEST_ASSERT_EQUAL_INT(1, totalCorrectAnswers); } +void test_processUserAnswer_correctAnswer_index0(void) { + int score = 0; + int totalCorrectAnswers = 0; + char* answers[] = {"A", "B", "C", "D"}; + processUserAnswer(1, 0, &score, &totalCorrectAnswers, answers); + TEST_ASSERT_EQUAL_INT(1, score); + TEST_ASSERT_EQUAL_INT(1, totalCorrectAnswers); +} #endif //TEST