You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.6 KiB
65 lines
1.6 KiB
#ifdef TEST
|
|
|
|
#include <stdbool.h>
|
|
#include <stdio.h>
|
|
#include "unity.h"
|
|
#include "casualQuiz.h"
|
|
|
|
// Test setup function
|
|
void setUp(void) {
|
|
|
|
}
|
|
|
|
// Test teardown function
|
|
void tearDown(void) {
|
|
|
|
}
|
|
|
|
void test_FcheckaufRichtigkeit_correct_answer_atIndex1(void){
|
|
int TESTeingabe = 1;
|
|
int TESTindex = 0;
|
|
int TESTrichtige_antwort[]={1};
|
|
bool testfall;
|
|
testfall = FcheckaufRichtigkeit(TESTeingabe, TESTrichtige_antwort, TESTindex);
|
|
|
|
TEST_ASSERT_TRUE(testfall == true);
|
|
|
|
}
|
|
void test_FcheckaufRichtigkeit_correct_answer_atIndex2(void){
|
|
int TESTeingabe = 2;
|
|
int TESTindex = 0;
|
|
int TESTrichtige_antwort[]={2};
|
|
bool testfall;
|
|
testfall = FcheckaufRichtigkeit(TESTeingabe, TESTrichtige_antwort, TESTindex);
|
|
|
|
TEST_ASSERT_TRUE(testfall == true);
|
|
|
|
}
|
|
void test_FcheckaufRichtigkeit_correct_answer_atIndex3(void){
|
|
int TESTeingabe = 3;
|
|
int TESTindex = 0;
|
|
int TESTrichtige_antwort[]={3};
|
|
bool testfall;
|
|
testfall = FcheckaufRichtigkeit(TESTeingabe, TESTrichtige_antwort, TESTindex);
|
|
|
|
TEST_ASSERT_TRUE(testfall == true);
|
|
|
|
}void test_FcheckaufRichtigkeit_correct_answer_atIndex4(void){
|
|
int TESTeingabe = 4;
|
|
int TESTindex = 0;
|
|
int TESTrichtige_antwort[]={4};
|
|
bool testfall;
|
|
testfall = FcheckaufRichtigkeit(TESTeingabe, TESTrichtige_antwort, TESTindex);
|
|
|
|
TEST_ASSERT_TRUE(testfall == true);
|
|
|
|
}
|
|
void test_FcheckaufRichtigkeit_incorrect_input(void){
|
|
int TESTeingabe = 5;
|
|
int TESTindex = 0;
|
|
int TESTrichtige_antwort[]={3};
|
|
bool testfall;
|
|
testfall = FcheckaufRichtigkeit(TESTeingabe, TESTrichtige_antwort, TESTindex);
|
|
TEST_ASSERT_TRUE(testfall != true);
|
|
}
|
|
#endif //Test
|