diff --git a/src/main/c/Stefan/blackjack.c b/src/main/c/Stefan/blackjack.c index c358caf..0b376f2 100644 --- a/src/main/c/Stefan/blackjack.c +++ b/src/main/c/Stefan/blackjack.c @@ -266,7 +266,7 @@ char generateCardAscii(int cardValue){ case(0): cardValueAsChar = 'J'; break; case(1): cardValueAsChar = 'Q'; break; case(2): cardValueAsChar = 'K'; break; - case(4): cardValueAsChar = '1'; + case(3): cardValueAsChar = '1'; possibleZero = '0'; break; default: cardValueAsChar = 'E'; break; // ERROR } diff --git a/src/test/c/Stefan/test_blackjack.c b/src/test/c/Stefan/test_blackjack.c index f65013b..9497d5e 100644 --- a/src/test/c/Stefan/test_blackjack.c +++ b/src/test/c/Stefan/test_blackjack.c @@ -227,3 +227,17 @@ void test_generate_char_for_card_9() { TEST_ASSERT_EQUAL_CHAR(expected_result, actual_result); } + +void test_generate_char_for_card_5() { + + //arrange + int cardValue = 5; + char expected_result = '5'; + + //act + char actual_result = generateCardAscii(cardValue); + + //assert + TEST_ASSERT_EQUAL_CHAR(expected_result, actual_result); + +} \ No newline at end of file