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

import org.junit.Test;


public class BowlingGameTest {

	@Test
	public void itCompiles() {
		assertThat(true, equalTo(true));;
	}
	
	@Test
	public void testGutterGame(){
		Game game = new Game();
		for(int i=0;i<20;i++){
			game.roll(0	);
		}
		assertEquals(0, game.score());
	}
	
	@Test
	public void testAllOne(){
		Game game = new Game();
		for(int i=0;i<20;i++){
			game.roll(1	);
		}
		assertEquals(20, game.score());
	}

}

@@ -126,16 +126,41 @@
 ualTo;%0A%0A
+import org.junit.Before;%0A
 import o
@@ -175,17 +175,16 @@
 .Test;%0A%0A
-%0A
 public c
@@ -207,16 +207,37 @@
 Test %7B%0A%0A
+%09private Game game;%0A%0A
 %09@Test%0A%09
@@ -297,29 +297,31 @@
 (true));
-;
+%0A%09%09
 %0A%09%7D%0A
-%09%0A
 %09@
-Test
+Before
 %0A%09public
@@ -330,98 +330,118 @@
 oid 
-testGutterGame()%7B%0A%09%09Game game = new Game();%0A%09%09for(int i=0;i%3C20;i++)%7B%0A%09%09%09game.roll(0%09);%0A%09%09%7D
+setUp() throws Exception %7B%0A%09%09game = new Game();%0A%09%7D%0A%0A%09@Test%0A%09public void testGutterGame() %7B%0A%0A%09%09rollMany(20, 0);
 %0A%09%09a
@@ -473,17 +473,16 @@
 ());%0A%09%7D%0A
-%09
 %0A%09@Test%0A
@@ -510,59 +510,141 @@
 ne()
+ 
 %7B%0A
-%09%09Game game = new Game();
+%0A%09%09rollMany(20, 1);%0A%09%09assertEquals(20, game.score());%0A%09%7D%0A%0A%09private void rollMany(int n, int pins) %7B
 %0A%09%09for
+ 
 (int i
-=0;i%3C20;
+ = 0; i %3C n; 
 i++)
+ 
 %7B%0A%09%09
@@ -658,18 +658,20 @@
 oll(
-1%09
+pins
 );%0A%09%09%7D%0A%09
 %09ass
@@ -670,43 +670,20 @@
 %09%7D%0A%09
-%09assertEquals(20, game.score());%0A%09%7D
+%7D%0A%0A%09// @Test
 %0A%0A%7D%0A

test 3 refactor