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());
	}
	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);
		}
	}


}

@@ -302,14 +302,13 @@
 ));%0A
-%09%09
 %0A
+
 %09%7D%0A
+%0A
 %09@Be
@@ -569,10 +569,9 @@
 %0A%09%7D%0A
-%09
 %0A
+
 %09@Te
@@ -600,16 +600,17 @@
 eSpare()
+ 
 %7B%0A%09%09roll
@@ -690,16 +690,188 @@
 ());%0A%09%7D%0A
+%0A%09@Test%0A%09public void testOneStrike() throws Exception %7B%0A%09%09game.roll(10); // strike%0A%09%09game.roll(3);%0A%09%09game.roll(4);%0A%09%09rollMany(16, 0);%0A%09%09assertEquals(24, game.score());%0A%09%7D%0A%0A
 %09private
@@ -1028,11 +1028,10 @@
 %09%09%7D%0A
+
 %09%7D%0A%0A
-%0A
 %7D%0A

test 5 red