diff --git a/src/c/rockPaperScissors.h b/src/c/rockPaperScissors.h index cda1894..73dd319 100644 --- a/src/c/rockPaperScissors.h +++ b/src/c/rockPaperScissors.h @@ -8,9 +8,9 @@ enum inputOptions{ }; enum roundWinner{ - PLAYERWINSROUND = 'p', - COMPUTERWINSROUND = 'c', - NOWINNER = 'n' + PLAYERWINSROUND, + COMPUTERWINSROUND, + NOWINNER }; diff --git a/test/c/test_rockPaperScissors.c b/test/c/test_rockPaperScissors.c index 327b2d7..dea8ee4 100644 --- a/test/c/test_rockPaperScissors.c +++ b/test/c/test_rockPaperScissors.c @@ -17,7 +17,7 @@ void test_rockPaperScissors_sameResult(void) { /* arrange */ //Hier die Werte eingeben - char result; //p=player, c=computer, n=none + char result; int inputPlayer = ROCK; int inputComputer = inputPlayer; @@ -27,14 +27,14 @@ void test_rockPaperScissors_sameResult(void) /* assert */ //Vergleichen - TEST_ASSERT_EQUAL_INT('n', result); + TEST_ASSERT_EQUAL_INT(NOWINNER, result); } void test_rockPaperScissors_differentResultsPlayerWins(void) { /* arrange */ //Hier die Werte eingeben - char result; //p=player, c=computer, n=none + char result; int inputPlayer = ROCK; int inputComputer = SCISSORS; @@ -44,7 +44,7 @@ void test_rockPaperScissors_differentResultsPlayerWins(void) /* assert */ //Vergleichen - TEST_ASSERT_EQUAL_INT('p', result); + TEST_ASSERT_EQUAL_INT(PLAYERWINSROUND, result); /* arrange */ //Hier die Werte eingeben @@ -57,7 +57,7 @@ void test_rockPaperScissors_differentResultsPlayerWins(void) /* assert */ //Vergleichen - TEST_ASSERT_EQUAL_INT('p', result); + TEST_ASSERT_EQUAL_INT(PLAYERWINSROUND, result); /* arrange */ //Hier die Werte eingeben @@ -70,14 +70,14 @@ void test_rockPaperScissors_differentResultsPlayerWins(void) /* assert */ //Vergleichen - TEST_ASSERT_EQUAL_INT('p', result); + TEST_ASSERT_EQUAL_INT(PLAYERWINSROUND, result); } void test_rockPaperScissors_differentResultsPlayerLoses(void) { /* arrange */ //Hier die Werte eingeben - char result; //p=player, c=computer, n=none + char result; int inputPlayer = ROCK; int inputComputer = PAPER; @@ -87,7 +87,7 @@ void test_rockPaperScissors_differentResultsPlayerLoses(void) /* assert */ //Vergleichen - TEST_ASSERT_EQUAL_INT('c', result); + TEST_ASSERT_EQUAL_INT(COMPUTERWINSROUND, result); /* arrange */ //Hier die Werte eingeben @@ -100,7 +100,7 @@ void test_rockPaperScissors_differentResultsPlayerLoses(void) /* assert */ //Vergleichen - TEST_ASSERT_EQUAL_INT('c', result); + TEST_ASSERT_EQUAL_INT(COMPUTERWINSROUND, result); /* arrange */ //Hier die Werte eingeben @@ -113,7 +113,7 @@ void test_rockPaperScissors_differentResultsPlayerLoses(void) /* assert */ //Vergleichen - TEST_ASSERT_EQUAL_INT('c', result); + TEST_ASSERT_EQUAL_INT(COMPUTERWINSROUND, result); } #endif // TEST