@ -107,7 +107,7 @@ int getWinnings(char symbols[], int bet){
if (symbols[i * ROWS] == symbols[i * ROWS + 1] && symbols[i * ROWS] == symbols[i * ROWS + 2]) {
switch(symbols[i]){
switch(symbols[i * ROWS]){
case 'A': winnings = bet * 3; break;
case 'B': winnings = bet * 5; break;
case 'C': winnings = bet * 10; break;
@ -38,4 +38,19 @@ void test_subtract_bet_5_from_balance_10() {
//assert
TEST_ASSERT_EQUAL_INT(expectedResult, actualResult);
}
void test_no_rows_won_bet_equals_10() {
//arrange
char testSymbols[] = {"AABAACAAD"};
int expectedResult = 0;
//act
int actualResult = getWinnings(testSymbols, 10);