|
@ -1,5 +1,6 @@ |
|
|
#include "hangman.h" |
|
|
#include "hangman.h" |
|
|
#include "unity.h" |
|
|
#include "unity.h" |
|
|
|
|
|
#include <string.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -13,12 +14,26 @@ void tearDown(void) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void test_ceedling_functionality() |
|
|
|
|
|
|
|
|
void test_getWordFromList_Kartoffel_0() |
|
|
{ |
|
|
{ |
|
|
//arrange |
|
|
//arrange |
|
|
int expectedResult = 0; |
|
|
|
|
|
|
|
|
int pos = 0; |
|
|
|
|
|
char expectedResult[] = "Kartoffel"; |
|
|
//act |
|
|
//act |
|
|
int actualResult = 0; |
|
|
|
|
|
|
|
|
char actualResult[30]; |
|
|
|
|
|
strcpy(actualResult,getWordFromList(pos)); |
|
|
//assert |
|
|
//assert |
|
|
TEST_ASSERT_EQUAL_INT(expectedResult, actualResult); |
|
|
|
|
|
|
|
|
TEST_ASSERT_EQUAL_STRING(expectedResult, actualResult); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void test_getWordFromList_Kleiderschrank_5() |
|
|
|
|
|
{ |
|
|
|
|
|
//arrange |
|
|
|
|
|
int pos = 5; |
|
|
|
|
|
char expectedResult[] = "Kleiderschrank"; |
|
|
|
|
|
//act |
|
|
|
|
|
char actualResult[30]; |
|
|
|
|
|
strcpy(actualResult,getWordFromList(pos)); |
|
|
|
|
|
//assert |
|
|
|
|
|
TEST_ASSERT_EQUAL_STRING(expectedResult, actualResult); |
|
|
} |
|
|
} |