Gomoku/test/gomoku/PlateauTest.java
/**
     * Test of etatId method, of class Plateau.
     */
Test of etatId method, of class Plateau.
Test of etatId method of class Plateau .
@Test
    public void testEtatId() throws OutOfBoundException {
        System.out.println("etatId");
        Coup[] coups = new Coup[]
        {
            new Coup(3, 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(3, new Position(2, 2))  
        };
        Plateau instance = new Plateau(5, 5);
        instance.initialiser(coups);
        ArrayList<Position> result = instance.etatId(3);
        assertEquals(3, result.size());
        int index = result.size() - 1;
        for(Coup c : coups)
            if(c.id == 3)
                if(!c.pos.equals(result.get(index)))
                    fail("getSituation ne retourne pas les bons résultats");
                else
                    index--;
    }
@ Test public void testEtatId ( ) throws OutOfBoundException { System . out . println ( "etatId" ) ; Coup [ ] coups = new Coup [ ] { new Coup ( 3 , 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 ( 3 , new Position ( 2 , 2 ) ) } ; Plateau instance = new Plateau ( 5 , 5 ) ; instance . initialiser ( coups ) ; ArrayList < Position > result = instance . etatId ( 3 ) ; assertEquals ( 3 , result . size ( ) ) ; int index = result . size ( ) - 1 ; for ( Coup c : coups ) if ( c . id == 3 ) if ( ! c . pos . equals ( result . get ( index ) ) ) fail ( "getSituation ne retourne pas les bons résultats") ; else index -- ; }
Test of etatId method, of class Plateau.
Test of etatId method of class Plateau .
// !
 // !
 // !
