From 289293d5ffc3d165e6963c94022613589d83dfee Mon Sep 17 00:00:00 2001 From: fdai7472 Date: Mon, 29 Jan 2024 18:24:54 +0100 Subject: [PATCH] Tests, falls eine Reihe gewinnt --- src/test/c/Stefan/test_slot_machine.c | 57 ++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/src/test/c/Stefan/test_slot_machine.c b/src/test/c/Stefan/test_slot_machine.c index 76f8258..8a05f53 100644 --- a/src/test/c/Stefan/test_slot_machine.c +++ b/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); +}