package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events;

import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters.Hunter;
import it.polimi.ingsw.gc14.Model.Player;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.Arrays;

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

class HuntTest {

    @Test
    void activateEvent() {
        Player p1 = new Player("Giacomo");
        Player p2 = new Player("xiaomi");


        ArrayList<Player> players = new ArrayList<>(Arrays.asList(p1,p2));
        Hunt h1 = new Hunt(1, 3);
        h1.activateEvent(players);

        assertEquals(0, p1.getPrestigeValue());
        assertEquals(1, p1.getFoodValue());
        assertEquals(0, p2.getPrestigeValue());
        assertEquals(1, p2.getFoodValue());


        Hunt h2 = new Hunt(1, 3);
        Hunter hunter1 = new Hunter(1, true);
        Hunter hunter2 = new Hunter(1, false);
        p1.hunters.add(hunter1);
        p1.hunters.add(hunter2);

        Hunter hunter3 = new Hunter(1, false);
        p2.hunters.add(hunter3);

        h2.activateEvent(players);
        assertEquals(6, p1.getPrestigeValue());
        assertEquals(2, p1.getFoodValue());
        assertEquals(3, p2.getPrestigeValue());
        assertEquals(3, p2.getPrestigeValue());
        assertEquals(2, p2.getFoodValue());



    }
}