Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JogoShugh/6f06ae0570599f4f7de0 to your computer and use it in GitHub Desktop.
Save JogoShugh/6f06ae0570599f4f7de0 to your computer and use it in GitHub Desktop.
public class when_I_roll_a_game_with_even_a_single_strike_and_try_to_roll_past_ten_frames : concerns<BowlingGame>
{
[Specification]
public void then_I_get_an_exception()
{
Assert.Throws<ApplicationException>(() =>
{
var game = build_up();
game.Roll(10);
9.times(() =>
{
game.Roll(9);
game.Roll(1);
});
game.Roll(1); // Spare bonus, yay
game.Roll(0); // Ha! Should fail!
});
}
}
public class when_I_roll_an_even_more_perfecter_game : concerns<BowlingGame>
{
[Specification]
public void then_I_get_an_exception()
{
Assert.Throws<ApplicationException>(() =>
{
var game = build_up();
12.times(() => game.Roll(10));
game.Roll(1);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment