From f676c625514bf823ccd62596da3c6b9b0abddd2e Mon Sep 17 00:00:00 2001 From: Pascal Schneider Date: Tue, 6 Feb 2024 21:39:13 +0100 Subject: [PATCH] =?UTF-8?q?refactoring:=20Test=20Datei=20Kommentare=20hinz?= =?UTF-8?q?ugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test_timequiz.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/test_timequiz.c b/test/test_timequiz.c index 1483093..df43b2e 100644 --- a/test/test_timequiz.c +++ b/test/test_timequiz.c @@ -8,14 +8,14 @@ void setUp(void) { void tearDown(void) { } - +//Funktion schaut, ob richtger Index rausgegeben wird void test_getRandomQuestionIndex(void) { int askedQuestions[10] = {0}; int totalQuestions = 10; int index = getRandomQuestionIndex(askedQuestions, totalQuestions); TEST_ASSERT_TRUE(index >= 0 && index < totalQuestions); } - +//Funktion schaut, ob die Fragen richtig angezeigt werden void test_displayQuestion(void) { const char* question = "Test Question"; const char* answers[] = {"A", "B", "C", "D"}; @@ -29,7 +29,7 @@ void test_displayQuestion(void) { printf("Actual Output:\n"); displayQuestion(question, answers, correctIndex); } - +//Funktion schaut, ob User-Eingabe richtig ist void test_processUserAnswer_correct(void) { int score = 0; int totalCorrectAnswers = 0; @@ -41,7 +41,7 @@ void test_processUserAnswer_correct(void) { TEST_ASSERT_EQUAL_INT(1, score); TEST_ASSERT_EQUAL_INT(1, totalCorrectAnswers); } - +//Funktion schaut, ob User-Eingabe falsch ist void test_processUserAnswer_wrong(void) { int score = 0; int totalCorrectAnswers = 0; @@ -52,7 +52,7 @@ void test_processUserAnswer_wrong(void) { TEST_ASSERT_EQUAL_INT(0, score); TEST_ASSERT_EQUAL_INT(0, totalCorrectAnswers); } - +//Funktion schaut, ob User-Eingabe richtig ist void test_processUserAnswer_correctAnswer_index3(void) { int score = 0; int totalCorrectAnswers = 0; @@ -61,7 +61,7 @@ void test_processUserAnswer_correctAnswer_index3(void) { TEST_ASSERT_EQUAL_INT(1, score); TEST_ASSERT_EQUAL_INT(1, totalCorrectAnswers); } - +//Funktion schaut, ob User-Eingabe richtig ist void test_processUserAnswer_correctAnswer_index0(void) { int score = 0; int totalCorrectAnswers = 0; @@ -70,7 +70,7 @@ void test_processUserAnswer_correctAnswer_index0(void) { TEST_ASSERT_EQUAL_INT(1, score); TEST_ASSERT_EQUAL_INT(1, totalCorrectAnswers); } - +//Funktion schaut, ob User-Eingabe falsch ist void test_processUserAnswer_wrongAnswer_index3(void) { int score = 0; int totalCorrectAnswers = 0; @@ -81,7 +81,7 @@ void test_processUserAnswer_wrongAnswer_index3(void) { TEST_ASSERT_EQUAL_INT(0, score); TEST_ASSERT_EQUAL_INT(0, totalCorrectAnswers); } - +//Funktion schaut, ob User-Eingabe richtig ist void test_processUserAnswer_correctAnswer_index1(void) { int score = 0; int totalCorrectAnswers = 0; @@ -92,7 +92,7 @@ void test_processUserAnswer_correctAnswer_index1(void) { TEST_ASSERT_EQUAL_INT(1, score); TEST_ASSERT_EQUAL_INT(1, totalCorrectAnswers); } - +//Funktion schaut, ob User-Eingabe richtig ist void test_processUserAnswer_correctAnswer_index2(void) { int score = 0; int totalCorrectAnswers = 0; @@ -103,7 +103,7 @@ void test_processUserAnswer_correctAnswer_index2(void) { TEST_ASSERT_EQUAL_INT(1, score); TEST_ASSERT_EQUAL_INT(1, totalCorrectAnswers); } - +//Funktion schaut, ob User-Eingabe falsch ist void test_processUserAnswer_wrongAnswer_index1(void) { int score = 0; int totalCorrectAnswers = 0;