Browse Source

Tests, falls eine Reihe gewinnt

remotes/origin/dev
fdai7472 11 months ago
parent
commit
289293d5ff
  1. 57
      src/test/c/Stefan/test_slot_machine.c

57
src/test/c/Stefan/test_slot_machine.c

@ -45,7 +45,6 @@ void test_no_rows_won_bet_equals_10() {
//arrange
char testSymbols[] = {"AABAACAAD"};
int expectedResult = 0;
//act
@ -54,3 +53,59 @@ void test_no_rows_won_bet_equals_10() {
//assert
TEST_ASSERT_EQUAL_INT(expectedResult, actualResult);
}
void test_3_A_won_bet_equals_10() {
//arrange
char testSymbols[] = {"AAAAACAAD"};
int expectedResult = 30;
//act
int actualResult = getWinnings(testSymbols, 10);
//assert
TEST_ASSERT_EQUAL_INT(expectedResult, actualResult);
}
void test_3_B_won_bet_equals_10() {
//arrange
char testSymbols[] = {"BBBAACAAD"};
int expectedResult = 50;
//act
int actualResult = getWinnings(testSymbols, 10);
//assert
TEST_ASSERT_EQUAL_INT(expectedResult, actualResult);
}
void test_3_C_won_bet_equals_10() {
//arrange
char testSymbols[] = {"BABAACCCC"};
int expectedResult = 100;
//act
int actualResult = getWinnings(testSymbols, 10);
//assert
TEST_ASSERT_EQUAL_INT(expectedResult, actualResult);
}
void test_3_D_won_bet_equals_10() {
//arrange
char testSymbols[] = {"BABDDDCAC"};
int expectedResult = 200;
//act
int actualResult = getWinnings(testSymbols, 10);
//assert
TEST_ASSERT_EQUAL_INT(expectedResult, actualResult);
}
Loading…
Cancel
Save