EMMA Coverage Report (generated Fri Mar 15 09:08:15 CET 2013)
[all classes][jpacman.model]

COVERAGE SUMMARY FOR SOURCE FILE [PlayerMoveTest.java]

nameclass, %method, %block, %line, %
PlayerMoveTest.java100% (1/1)100% (3/3)100% (42/42)100% (10/10)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PlayerMoveTest100% (1/1)100% (3/3)100% (42/42)100% (10/10)
PlayerMoveTest (): void 100% (1/1)100% (3/3)100% (1/1)
createMove (Cell): PlayerMove 100% (1/1)100% (11/11)100% (2/2)
testSimpleGetters (): void 100% (1/1)100% (28/28)100% (7/7)

1package jpacman.model;
2 
3import static org.junit.Assert.assertEquals;
4import static org.junit.Assert.assertFalse;
5import static org.junit.Assert.assertTrue;
6 
7import org.junit.Test;
8 
9/**
10 * Specialize the general MoveTest test suite to one
11 * that is tailored to PlayerMoves.
12 * Thanks to inheritance, all test cases from MoveTest
13 * are also methods in PlayerMoveTest, thus helping us
14 * to test conformance with Liskov's Substitution Principle (LSP)
15 * of the Move hierarchy.
16 * <p>
17 * @author Arie van Deursen; August 21, 2003.
18 * @version $Id: PlayerMoveTest.java,v 1.8 2008/02/10 19:51:11 arie Exp $
19 */
20public class PlayerMoveTest extends MoveTest {
21 
22    /**
23     * The move the player would like to make.
24     */
25    private PlayerMove aPlayerMove;
26 
27    /**
28     * Simple test of a few getters.
29     */
30    @Test
31    public void testSimpleGetters() {
32        PlayerMove playerMove = new PlayerMove(thePlayer, foodCell);
33        assertEquals(thePlayer, playerMove.getPlayer());
34        assertTrue(playerMove.movePossible());
35        assertFalse(playerMove.playerDies());
36        assertEquals(1, playerMove.getFoodEaten());
37        assertTrue(playerMove.invariant());
38    }
39 
40 
41    /**
42     * Create a move object that will be tested.
43     *  @see jpacman.model.MoveTest#createMove(jpacman.model.Cell)
44     *  @param target The cell to be occupied by the move.
45     *  @return The move to be tested.
46     */
47    @Override
48    protected PlayerMove createMove(Cell target) {
49        aPlayerMove = new PlayerMove(thePlayer, target);
50        return aPlayerMove;
51    }
52}

[all classes][jpacman.model]
EMMA 2.0.5312 (C) Vladimir Roubtsov