diff --git a/build/test/cache/test_quizduell.c b/build/test/cache/test_quizduell.c index 25a4bb9..c368f4e 100644 --- a/build/test/cache/test_quizduell.c +++ b/build/test/cache/test_quizduell.c @@ -295,3 +295,15 @@ void test_befreieKategorie(void) { ), (UNITY_UINT)(96), UNITY_DISPLAY_STYLE_INT); } + +void test_pruefeAntwort_CorrectAnswer(void) { + + QuizFrage frage = erstelleFrage("Test Question", "Option A", "Option B", "Option C", "Option D", 'A'); + + UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((pruefeAntwort(frage, 'A'))), ( + + ((void *)0) + + ), (UNITY_UINT)(100), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/out/c/test_quizduell.o b/build/test/out/c/test_quizduell.o index 6186864..03646e3 100644 Binary files a/build/test/out/c/test_quizduell.o and b/build/test/out/c/test_quizduell.o differ diff --git a/build/test/out/c/test_quizduell_runner.o b/build/test/out/c/test_quizduell_runner.o index eefeebb..c6cd6d5 100644 Binary files a/build/test/out/c/test_quizduell_runner.o and b/build/test/out/c/test_quizduell_runner.o differ diff --git a/build/test/out/test_quizduell.out b/build/test/out/test_quizduell.out index 88638f7..d794fbd 100755 Binary files a/build/test/out/test_quizduell.out and b/build/test/out/test_quizduell.out differ diff --git a/build/test/preprocess/files/test_quizduell.c b/build/test/preprocess/files/test_quizduell.c index 25a4bb9..c368f4e 100644 --- a/build/test/preprocess/files/test_quizduell.c +++ b/build/test/preprocess/files/test_quizduell.c @@ -295,3 +295,15 @@ void test_befreieKategorie(void) { ), (UNITY_UINT)(96), UNITY_DISPLAY_STYLE_INT); } + +void test_pruefeAntwort_CorrectAnswer(void) { + + QuizFrage frage = erstelleFrage("Test Question", "Option A", "Option B", "Option C", "Option D", 'A'); + + UnityAssertEqualNumber((UNITY_INT)((1)), (UNITY_INT)((pruefeAntwort(frage, 'A'))), ( + + ((void *)0) + + ), (UNITY_UINT)(100), UNITY_DISPLAY_STYLE_INT); + +} diff --git a/build/test/results/test_casualQuiz.pass b/build/test/results/test_casualQuiz.pass index 0aec465..e97b617 100644 --- a/build/test/results/test_casualQuiz.pass +++ b/build/test/results/test_casualQuiz.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.01776380000046629 +:time: 0.01634360000025481 diff --git a/build/test/results/test_quizduell.pass b/build/test/results/test_quizduell.pass index ac99bf1..6d65d10 100644 --- a/build/test/results/test_quizduell.pass +++ b/build/test/results/test_quizduell.pass @@ -23,12 +23,16 @@ :line: 86 :message: '' :unity_test_time: 0 +- :test: test_pruefeAntwort_CorrectAnswer + :line: 98 + :message: '' + :unity_test_time: 0 :failures: [] :ignores: [] :counts: - :total: 5 - :passed: 5 + :total: 6 + :passed: 6 :failed: 0 :ignored: 0 :stdout: [] -:time: 0.030904999999620486 +:time: 0.030828099999780534 diff --git a/build/test/results/test_timequiz.pass b/build/test/results/test_timequiz.pass index 4d602aa..5e8f14b 100644 --- a/build/test/results/test_timequiz.pass +++ b/build/test/results/test_timequiz.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.016614099999060272 +:time: 0.016310499999235617 diff --git a/build/test/results/test_wwm.pass b/build/test/results/test_wwm.pass index 7fa146d..7ef11ae 100644 --- a/build/test/results/test_wwm.pass +++ b/build/test/results/test_wwm.pass @@ -11,4 +11,4 @@ :failed: 0 :ignored: 0 :stdout: [] -:time: 0.018228900000394788 +:time: 0.01756539999951201 diff --git a/build/test/runners/test_quizduell_runner.c b/build/test/runners/test_quizduell_runner.c index c3b2715..8ea615a 100644 --- a/build/test/runners/test_quizduell_runner.c +++ b/build/test/runners/test_quizduell_runner.c @@ -15,6 +15,7 @@ extern void test_CookingFragen(void); extern void test_MountainsFragen(void); extern void test_createCategory2WithQuestions(void); extern void test_befreieKategorie(void); +extern void test_pruefeAntwort_CorrectAnswer(void); /*=======Mock Management=====*/ @@ -84,6 +85,7 @@ int main(void) run_test(test_MountainsFragen, "test_MountainsFragen", 44); run_test(test_createCategory2WithQuestions, "test_createCategory2WithQuestions", 65); run_test(test_befreieKategorie, "test_befreieKategorie", 86); + run_test(test_pruefeAntwort_CorrectAnswer, "test_pruefeAntwort_CorrectAnswer", 98); return UnityEnd(); } diff --git a/test/test_quizduell.c b/test/test_quizduell.c index f5b4701..093d19e 100644 --- a/test/test_quizduell.c +++ b/test/test_quizduell.c @@ -99,4 +99,8 @@ void test_pruefeAntwort_CorrectAnswer(void) { QuizFrage frage = erstelleFrage("Test Question", "Option A", "Option B", "Option C", "Option D", 'A'); TEST_ASSERT_EQUAL_INT(1, pruefeAntwort(frage, 'A')); } +void test_pruefeAntwort_WrongAnswer(void) { + QuizFrage frage = erstelleFrage("Test Question", "Option A", "Option B", "Option C", "Option D", 'A'); + TEST_ASSERT_EQUAL_INT(0, pruefeAntwort(frage, 'B')); +} #endif //TEST \ No newline at end of file