Browse Source

5. Unittest

remotes/origin/Pascal
Pascal Schneider 11 months ago
parent
commit
b92f32503f
  1. 10
      test/test_timequiz.c

10
test/test_timequiz.c

@ -68,4 +68,14 @@ void test_processUserAnswer_wrong(void) {
TEST_ASSERT_EQUAL_INT(0, totalCorrectAnswers);
}
void test_processUserAnswer_correctAnswer_index3(void) {
int score = 0;
int totalCorrectAnswers = 0;
char* answers[] = {"A", "B", "C", "D"};
processUserAnswer(4, 3, &score, &totalCorrectAnswers, answers);
TEST_ASSERT_EQUAL_INT(1, score);
TEST_ASSERT_EQUAL_INT(1, totalCorrectAnswers);
}
#endif //TEST
Loading…
Cancel
Save