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

COVERAGE SUMMARY FOR SOURCE FILE [CellTest.java]

nameclass, %method, %block, %line, %
CellTest.java100% (1/1)100% (3/3)100% (63/63)100% (11/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CellTest100% (1/1)100% (3/3)100% (63/63)100% (11/11)
CellTest (): void 100% (1/1)100% (9/9)100% (2/2)
setUpBoard (): void 100% (1/1)100% (17/17)100% (3/3)
testCellAtOffset (): void 100% (1/1)100% (37/37)100% (6/6)

1package jpacman.model;
2 
3import static org.junit.Assert.assertEquals;
4 
5import org.junit.Before;
6import org.junit.Test;
7 
8/**
9 * Test suite for methods working directly on Cells.
10 *
11 * @author Arie van Deursen; Jul 29, 2003
12 * @version $Id: CellTest.java,v 1.16 2008/02/10 12:51:55 arie Exp $
13 */
14public class CellTest {
15 
16    /**
17     * Width & heigth of board to be used.
18     */
19    private final int width = 4, height = 5;
20 
21    /**
22     * The board the cells occur on.
23     */
24    private Board aBoard;
25 
26    /**
27     * The "Cell Under Test".
28     */
29    private Cell aCell;
30 
31    /**
32     * Actually create the board and the cell. *
33     */
34    @Before
35    public void setUpBoard() {
36        aBoard = new Board(width, height);
37        // put the cell on an invariant boundary value.
38        aCell = new Cell(0, height - 1, aBoard);
39    }
40 
41 
42 
43    /**
44     * Test obtaining a cell at a given offset. Ensure both postconditions
45     * (null value if beyond border, value with board) are executed.
46     */
47    @Test
48    public void testCellAtOffset() {
49        assertEquals(height - 2, aCell.cellAtOffset(0, -1).getY());
50        assertEquals(0, aCell.cellAtOffset(0, -1).getX());
51        // assertNull(aCell.cellAtOffset(-1, 0));
52 
53        Cell cell11 = aBoard.getCell(1, 1);
54        Cell cell12 = aBoard.getCell(1, 2);
55        assertEquals(cell12, cell11.cellAtOffset(0, 1));
56    }
57 
58}

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