Browse Source

test_Buchstabe_im_zu_erratenden_wort 1

main^2
Peter Wiebe 11 months ago
committed by Peter Wiebe
parent
commit
016f5e1f61
  1. 23
      src/main/c/hangman.h
  2. 2
      src/main/c/hangman.txt
  3. 24
      src/test/c/test_hangman_test.c

23
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

2
src/main/c/hangman.txt

@ -1 +1 @@
name:peter,level:01
name:peter,level:02

24
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
Loading…
Cancel
Save