|
|
@ -45,3 +45,31 @@ void test_getRandomQuestionIndex(void) { |
|
|
|
do {if ((index >= 0 && index < totalQuestions)) {} else {UnityFail( ((" Expected TRUE Was FALSE")), (UNITY_UINT)((UNITY_UINT)(24)));}} while(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void test_displayQuestion(void) { |
|
|
|
|
|
|
|
char* question = "Test Question"; |
|
|
|
|
|
|
|
char* answers[] = {"A", "B", "C", "D"}; |
|
|
|
|
|
|
|
int correctIndex = 0; |
|
|
|
|
|
|
|
printf("\nExpected Output:\n"); |
|
|
|
|
|
|
|
printf("Question: %s\n", question); |
|
|
|
|
|
|
|
for (int i = 0; i < 4; i++) { |
|
|
|
|
|
|
|
printf("%d. %s\n", i + 1, answers[i]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
printf("\n"); |
|
|
|
|
|
|
|
printf("Actual Output:\n"); |
|
|
|
|
|
|
|
displayQuestion(question, answers, correctIndex); |
|
|
|
|
|
|
|
} |