Gomoku/test/gomoku/PlateauTest.java
/**
     * Test of getSituation method, of class Plateau.
     */
Test of getSituation method, of class Plateau.
Test of getSituation method of class Plateau .
@Test
    public void testGetSituation() throws OutOfBoundException {
        System.out.println("getSituation");
        Coup[] coups = new Coup[]
        {
            new Coup(1, new Position(0, 0)),
            new Coup(2, new Position(4, 0)),
            new Coup(3, new Position(0, 4)),
            new Coup(4, new Position(4, 4)),
            new Coup(5, new Position(2, 2))
        };
        Plateau instance = new Plateau(5, 5);
        instance.initialiser(coups);
        ArrayList<Coup> result = instance.getSituation();
        assertEquals(coups.length, result.size());
        for(int i = 0; i < coups.length; i++)
            if(!coups[i].pos.equals(result.get(i).pos) || coups[i].id != result.get(i).id)
                fail("getSituation ne retourne pas les bons résultats");
    }
@ Test public void testGetSituation ( ) throws OutOfBoundException { System . out . println ( "getSituation" ) ; Coup [ ] coups = new Coup [ ] { new Coup ( 1 , new Position ( 0 , 0 ) ) , new Coup ( 2 , new Position ( 4 , 0 ) ) , new Coup ( 3 , new Position ( 0 , 4 ) ) , new Coup ( 4 , new Position ( 4 , 4 ) ) , new Coup ( 5 , new Position ( 2 , 2 ) ) } ; Plateau instance = new Plateau ( 5 , 5 ) ; instance . initialiser ( coups ) ; ArrayList < Coup > result = instance . getSituation ( ) ; assertEquals ( coups . length , result . size ( ) ) ; for ( int i = 0 ; i < coups . length ; i ++ ) if ( ! coups [ i ] . pos . equals ( result . get ( i ) . pos ) || coups [ i ] . id != result . get ( i ) . id ) fail ( "getSituation ne retourne pas les bons résultats") ; }
Test of getSituation method, of class Plateau.
Test of getSituation method of class Plateau .