void test_all_ones_game(void) { roll_many(20, 1); TEST_ASSERT_EQUAL(20, bowling_game_score()); }
void test_gutter_game(void) { roll_many(20, 0); TEST_ASSERT_EQUAL(0, bowling_game_score()); }
static void test_single_spare( void){ bowling_game_init(); roll_once(5); roll_once(5); roll_once(5); roll_many(17,0); assert(bowling_game_score() == 20 && "Test Failed: single_spare"); }
static void test_single_strike( void){ bowling_game_init(); roll_once(10); roll_once(5); roll_once(2); roll_many(16,0); assert(bowling_game_score() == 24 && "Test Failed: single_strike"); }
void test_one_strike_last_frame(void) { roll_many(16, 0); bowling_game_roll(10); bowling_game_roll(3); bowling_game_roll(4); TEST_ASSERT_EQUAL(24, bowling_game_score()); }
void test_one_spare(void) { bowling_game_roll(5); bowling_game_roll(5); bowling_game_roll(3); roll_many(16, 0); TEST_ASSERT_EQUAL(16, bowling_game_score()); }
void test_one_strike(void) { bowling_game_roll(10); bowling_game_roll(3); bowling_game_roll(4); roll_many(17, 0); // Strike (10) + 3 + 4 TEST_ASSERT_EQUAL(24, bowling_game_score()); }
void test_all_strikes(void) { roll_many(12, 10); TEST_ASSERT_EQUAL(300, bowling_game_score()); }
static void test_gutter_game( void){ bowling_game_init(); roll_many(20, 0); assert(bowling_game_score() == 0 && "Test Failed: gutter_game"); }
static void test_perfect_game( void){ bowling_game_init(); roll_many(12,10); assert(bowling_game_score() == 300 && "Test Failed: perfect_game"); }