import static org.junit.Assert.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

import org.junit.Before;
import org.junit.Test;

public class BowlingGameTest {

	private Game game;

	@Test
	public void itCompiles() {
		assertThat(true, equalTo(true));

	}

	@Before
	public void setUp() throws Exception {
		game = new Game();
	}

	@Test
	public void testGutterGame() {

		rollMany(20, 0);
		assertEquals(0, game.score());
	}

	@Test
	public void testAllOne() {

		rollMany(20, 1);
		assertEquals(20, game.score());
	}

	@Test
	public void testOneSpare() {
		rollSpare();
		game.roll(3);
		rollMany(17, 0);
		assertEquals(16, game.score());
	}

	@Test
	public void testOneStrike() throws Exception {
		game.roll(10); // strike
		game.roll(3);
		game.roll(4);
		rollMany(16, 0);
		assertEquals(24, game.score());
	}

	private void rollSpare() {
		game.roll(5);
		game.roll(5);
	}

	private void rollMany(int n, int pins) {
		for (int i = 0; i < n; i++) {
			game.roll(pins);
		}
	}

}

@@ -856,24 +856,152 @@
 score());%0A%09%7D
+%0A%09%0A%09@Test%0A%09 public void testPerfectGame() throws Exception %7B%0A%09%09    rollMany(12,10);%0A%09%09    assertEquals(300, game.score());%0A%09%09  %7D
 %0A%0A%09private v

test 6 green