package server;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;

class TurnTileTest {
    TurnTile turnTile;

    Player player1 = new Player("A", TotemColor.PURPLE);
    Player player2 = new Player("B", TotemColor.YELLOW);
    Player player3 = new Player("C", TotemColor.BLUE);
    Player player4 = new Player("D", TotemColor.GREEN);
    Player player5 = new Player("E", TotemColor.RED);
    List<Player> players = new ArrayList<>();
    @BeforeEach
    public void setUp(){
        players.add(player1);
        players.add(player2);
        players.add(player3);
        players.add(player4);
        players.add(player5);
        turnTile = new TurnTile(5);
    }

    @Test
    void startOrder() {
       turnTile.setInitialOrder(players, false);
       assertEquals(player1, turnTile.nextToPlace());
        assertEquals(player2, turnTile.nextToPlace());
        assertEquals(player3, turnTile.nextToPlace());
        assertEquals(player4, turnTile.nextToPlace());
        assertEquals(player5, turnTile.nextToPlace());

    }

    @Test
    void giveReward() {
        turnTile.setInitialOrder(players, false);
        player5.addFood(1);
        System.out.println(player5);
        turnTile.returnTotem(player5);
        System.out.println(player5);
        assertEquals(0, player5.getFoodTokens());
    }


}