diff --git a/src/main/c/hangman.h b/src/main/c/hangman.h new file mode 100644 index 0000000..8d2ac70 --- /dev/null +++ b/src/main/c/hangman.h @@ -0,0 +1,23 @@ +#ifndef TEST_H +#define TEST_H + +void protokoll(); +void clear_screen(); +void willkommen(); +int namePruefen(); +void nameWaehlen(); +void startauswahl(); +void nameAusgeben(); +void levelauswahl(); +void hauptSpiel(int level); +void zeichne_galgen(int versuche); +void erratenen_buchstaben_hinzufuegen(char* guessed_letters, char guessed_letter); +char eingabe_buchstabe(); +void hole_zu_erratendes_wort(char* secret_word, int level, char* path); +void zeige_Buchstabenfeld(char secret_word[100], char guessed_letters[100]); +int buchstabe_im_zu_erratenden_wort(char guessed_letter, char secret_word[100]); +int gewonnen(char secret_word[100], char guessed_letters[100]); +void level_plus(); +int overlay(); + +#endif // TEST_H diff --git a/src/main/c/hangman.txt b/src/main/c/hangman.txt index 4456b2e..4e41ffd 100644 --- a/src/main/c/hangman.txt +++ b/src/main/c/hangman.txt @@ -1 +1 @@ -name:peter,level:01 \ No newline at end of file +name:peter,level:02 \ No newline at end of file diff --git a/src/test/c/test_hangman_test.c b/src/test/c/test_hangman_test.c new file mode 100644 index 0000000..b29661a --- /dev/null +++ b/src/test/c/test_hangman_test.c @@ -0,0 +1,24 @@ +#ifdef TEST + +#include "unity.h" +#include "hangman.h" + +void setUp(void) {} + +void tearDown(void) {} + +void test_Buchstabe_im_zu_erratenden_wort_eingabe_j_in_leerstring_falsch() { + // arrange + int expected = 1; + int actual; + char guessed_letter = 'j'; + char secret_word[100] = ""; + + // act + actual = Buchstabe_im_zu_erratenden_wort(guessed_letter, secret_word); + + // assert + TEST_ASSERT_EQUAL_INT(expected, actual); +} + +#endif // TEST