Browse Source

6. Unittest

remotes/origin/Pascal
Pascal Schneider 11 months ago
parent
commit
c75c552687
  1. 8
      test/test_timequiz.c

8
test/test_timequiz.c

@ -77,5 +77,13 @@ void test_processUserAnswer_correctAnswer_index3(void) {
TEST_ASSERT_EQUAL_INT(1, totalCorrectAnswers); 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 #endif //TEST
Loading…
Cancel
Save