コード例 #1
0
 /** Tests the resetScore method that the score is 0. */
 @Test
 @SuppressWarnings("checkstyle:magicnumber")
 public final void testresetScore() {
   player.addScore(10);
   player.resetScore();
   Assert.assertEquals(0, player.getScore());
 }
コード例 #2
0
 /**
  * Tests the behaviour of the addPoints method when adding a negative amount of points to the
  * players score.
  */
 @Test
 @SuppressWarnings("checkstyle:magicnumber")
 public final void testAddNegativeScore() {
   player.addScore(-10);
   Assert.assertEquals(-10, player.getScore());
 }
コード例 #3
0
 /** Test behaviour of the getScore method for the player class. */
 @Test
 @SuppressWarnings("checkstyle:magicnumber")
 public final void testGetScore() {
   Assert.assertEquals(0, player.getScore());
 }