|
|
@ -7,15 +7,12 @@ fn roll_returns_a_result() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn you_cannot_roll_more_than_ten_pins_in_a_single_roll() { |
|
|
|
fn you_cannot_roll_more_than_ten_pins_in_a_single_roll() { |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(game.roll(11), Err(Error::NotEnoughPinsLeft)); |
|
|
|
assert_eq!(game.roll(11), Err(Error::NotEnoughPinsLeft)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn a_game_score_is_some_if_ten_frames_have_been_rolled() { |
|
|
|
fn a_game_score_is_some_if_ten_frames_have_been_rolled() { |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
@ -28,15 +25,12 @@ fn a_game_score_is_some_if_ten_frames_have_been_rolled() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn you_cannot_score_a_game_with_no_rolls() { |
|
|
|
fn you_cannot_score_a_game_with_no_rolls() { |
|
|
|
let game = BowlingGame::new(); |
|
|
|
let game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
|
assert_eq!(game.score(), None); |
|
|
|
assert_eq!(game.score(), None); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn a_game_score_is_none_if_fewer_than_ten_frames_have_been_rolled() { |
|
|
|
fn a_game_score_is_none_if_fewer_than_ten_frames_have_been_rolled() { |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
@ -49,7 +43,6 @@ fn a_game_score_is_none_if_fewer_than_ten_frames_have_been_rolled() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn a_roll_is_err_if_the_game_is_done() { |
|
|
|
fn a_roll_is_err_if_the_game_is_done() { |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
@ -62,7 +55,6 @@ fn a_roll_is_err_if_the_game_is_done() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn twenty_zero_pin_rolls_scores_zero() { |
|
|
|
fn twenty_zero_pin_rolls_scores_zero() { |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
@ -74,7 +66,6 @@ fn twenty_zero_pin_rolls_scores_zero() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn ten_frames_without_a_strike_or_spare() { |
|
|
|
fn ten_frames_without_a_strike_or_spare() { |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
@ -87,7 +78,6 @@ fn ten_frames_without_a_strike_or_spare() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn spare_in_the_first_frame_followed_by_zeros() { |
|
|
|
fn spare_in_the_first_frame_followed_by_zeros() { |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
@ -102,7 +92,6 @@ fn spare_in_the_first_frame_followed_by_zeros() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn points_scored_in_the_roll_after_a_spare_are_counted_twice_as_a_bonus() { |
|
|
|
fn points_scored_in_the_roll_after_a_spare_are_counted_twice_as_a_bonus() { |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
@ -118,7 +107,6 @@ fn points_scored_in_the_roll_after_a_spare_are_counted_twice_as_a_bonus() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn consecutive_spares_each_get_a_one_roll_bonus() { |
|
|
|
fn consecutive_spares_each_get_a_one_roll_bonus() { |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
@ -152,7 +140,6 @@ fn if_the_last_frame_is_a_spare_you_get_one_extra_roll_that_is_scored_once() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn a_strike_earns_ten_points_in_a_frame_with_a_single_roll() { |
|
|
|
fn a_strike_earns_ten_points_in_a_frame_with_a_single_roll() { |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
@ -166,7 +153,6 @@ fn a_strike_earns_ten_points_in_a_frame_with_a_single_roll() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
|
|
|
|
fn points_scored_in_the_two_rolls_after_a_strike_are_counted_twice_as_a_bonus() { |
|
|
|
fn points_scored_in_the_two_rolls_after_a_strike_are_counted_twice_as_a_bonus() { |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
let mut game = BowlingGame::new(); |
|
|
|
|
|
|
|
|
|
|
@ -432,7 +418,6 @@ fn cannot_roll_after_bonus_roll_for_strike() { |
|
|
|
assert_eq!(game.roll(2), Err(Error::GameComplete)); |
|
|
|
assert_eq!(game.roll(2), Err(Error::GameComplete)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
#[test] |
|
|
|
#[ignore] |
|
|
|
#[ignore] |
|
|
|
fn last_two_strikes_followed_by_only_last_bonus_with_non_strike_points() { |
|
|
|
fn last_two_strikes_followed_by_only_last_bonus_with_non_strike_points() { |
|
|
|