|
|
@ -97,4 +97,16 @@ void test_processUserAnswer_wrongAnswer_index3(void) { |
|
|
|
TEST_ASSERT_EQUAL_INT(0, totalCorrectAnswers); |
|
|
|
} |
|
|
|
|
|
|
|
void test_processUserAnswer_correctAnswer_index1(void) { |
|
|
|
int score = 0; |
|
|
|
int totalCorrectAnswers = 0; |
|
|
|
char* answers[] = {"Paris", "London", "Berlin", "Madrid"}; |
|
|
|
int correctIndex = 1; |
|
|
|
int userAnswer = 2; // Assuming user selects the second option |
|
|
|
processUserAnswer(userAnswer, correctIndex, &score, &totalCorrectAnswers, answers); |
|
|
|
TEST_ASSERT_EQUAL_INT(1, score); |
|
|
|
TEST_ASSERT_EQUAL_INT(1, totalCorrectAnswers); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif //TEST |