|
|
@ -1,5 +1,6 @@ |
|
|
|
#include "blackjack.h" |
|
|
|
#include "unity.h" |
|
|
|
#include <stdbool.h> |
|
|
|
|
|
|
|
void setUp() {} |
|
|
|
|
|
|
@ -298,6 +299,26 @@ void test_generate_char_for_card_5() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void test_generate_char_for_card_10() { |
|
|
|
|
|
|
|
//arrange |
|
|
|
int cardValue = 10; |
|
|
|
|
|
|
|
//act |
|
|
|
bool result = false; |
|
|
|
switch(generateCardAscii(cardValue)){ |
|
|
|
case('1'): result = true; break; |
|
|
|
case('J'): result = true; break; |
|
|
|
case('Q'): result = true; break; |
|
|
|
case('K'): result = true; break; |
|
|
|
default: result = false; break; |
|
|
|
} |
|
|
|
|
|
|
|
//assert |
|
|
|
TEST_ASSERT_TRUE(result); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void test_subtract_bet_10_from_balance_100() { |
|
|
|
|
|
|
|
//arrange |
|
|
|