src/test/java/com/webcheckers/model/BoardViewTest.java
/**
     * Test to ensure red pieces are initialized properly.
     */
Test to ensure red pieces are initialized properly.
Test to ensure red pieces are initialized properly .
@Test
    public void red_pieces_init() {
        Iterator<Row> rowIterator= CuT.iterator();
        while (rowIterator.hasNext()) {
            Row row = rowIterator.next();
            int rowIdx = row.getIndex();
            Iterator<Space> spaceIterator = row.iterator();
            while (spaceIterator.hasNext()) {
                Space space = spaceIterator.next();
                Piece piece = space.getPiece();
                Space.Color color = space.getColor();
                if (rowIdx >= 5) {
                    if (color == Space.Color.DARK) {
                        assertEquals(Piece.PieceType.SINGLE, piece.type);
                        assertEquals(Piece.PieceColor.RED, piece.color);
                    }
                }
                else {
                    if (piece != null) {
                        assertNotEquals(Piece.PieceColor.RED, piece.color);
                    }
                }
            }
        }
    }
@ Test public void red_pieces_init ( ) { Iterator < Row > rowIterator = CuT . iterator ( ) ; while ( rowIterator . hasNext ( ) ) { Row row = rowIterator . next ( ) ; int rowIdx = row . getIndex ( ) ; Iterator < Space > spaceIterator = row . iterator ( ) ; while ( spaceIterator . hasNext ( ) ) { Space space = spaceIterator . next ( ) ; Piece piece = space . getPiece ( ) ; Space . Color color = space . getColor ( ) ; if ( rowIdx >= 5 ) { if ( color == Space . Color . DARK ) { assertEquals ( Piece . PieceType . SINGLE , piece . type ) ; assertEquals ( Piece . PieceColor . RED , piece . color ) ; } } else { if ( piece != null ) { assertNotEquals ( Piece . PieceColor . RED , piece . color ) ; } } } } }
Test to ensure red pieces are initialized properly.
Test to ensure red pieces are initialized properly .