예제 #1
0
 public void testAfterOneSpare() throws Exception {
   // rollSpare();
   g.roll(9);
   g.roll(1);
   assertEquals(10, g.scoreinprogress());
   assertEquals(10, g.getFrameScore(1));
   assertEquals('/', g.getFrameStatus(1));
   g.roll(6);
   assertEquals(16, g.getFrameScore(1));
   g.roll(2);
   assertEquals(16, g.getFrameScore(1));
 }
예제 #2
0
 public void testAfterOneStrike() throws Exception {
   g.roll(10); // strike
   assertEquals(10, g.scoreinprogress());
   assertEquals(10, g.getFrameScore(1));
   assertEquals('X', g.getFrameStatus(1));
   g.roll(3);
   assertEquals(3, g.getFrameScore(2));
   assertEquals(13, g.getFrameScore(1));
   assertEquals('.', g.getFrameStatus(2));
   g.roll(4);
   assertEquals(24, g.scoreinprogress());
   assertEquals(17, g.getFrameScore(1));
   assertEquals('^', g.getFrameStatus(2));
 }
예제 #3
0
 public void testAfterTwoStrike() throws Exception {
   g.roll(10); // strike
   assertEquals(10, g.getFrameScore(1));
   g.roll(10);
   assertEquals(10, g.getFrameScore(2));
   assertEquals(20, g.getFrameScore(1));
   g.roll(4);
   assertEquals(24, g.getFrameScore(1));
   assertEquals(14, g.getFrameScore(2));
   g.roll(6);
   assertEquals(24, g.getFrameScore(1));
   assertEquals(20, g.getFrameScore(2));
   g.roll(5);
   assertEquals(24, g.getFrameScore(1));
   assertEquals(20, g.getFrameScore(2));
   assertEquals(15, g.getFrameScore(3));
   assertEquals(5, g.getFrameScore(4));
   // System.out.println( "Hello World!" );
 }
예제 #4
0
 public void testScoreAfterOnePoorFrame() throws Exception {
   rollMany(2, 4);
   assertEquals(8, g.scoreinprogress());
   assertEquals(8, g.getFrameScore(1));
   // assertEquals(BowlingGame.FIRSTROLLINFRAME, g.getFrameState());
 }