package Server.Cards;

import org.junit.jupiter.api.Test;

import static Server.Era.I;
import static Server.Era.II;
import static org.junit.jupiter.api.Assertions.*;

class BuildingCardTest {


    //Test if the method parsRow is able to create a correct BuildingCard
    @Test
    void registerBuildingCard() {
        BuildingCard buildingCard = BuildingCard.parsRow("B;1;2;I;3;1;SHAMAN_BONUS");

        assertEquals(1, buildingCard.getCardId());
        assertEquals(2, buildingCard.getForMinPlayer());
        assertEquals(I, buildingCard.getEra());
        assertEquals(3, buildingCard.getCost());
        assertEquals(1, buildingCard.getCardId());
        assertEquals(Trigger.SHAMAN_BONUS, buildingCard.getAbilityTrigger());
        assertNull(buildingCard.getEffectTarget());
    }

    void registerBuildingCardWithTarget() {
        BuildingCard buildingCard = BuildingCard.parsRow("B;17;5;II;6;2;SUSTAIN_DISCOUNT;ARTIST");

        assertEquals(17, buildingCard.getCardId());
        assertEquals(5, buildingCard.getForMinPlayer());
        assertEquals(II, buildingCard.getEra());
        assertEquals(6, buildingCard.getCost());
        assertEquals(2, buildingCard.getCardId());
        assertEquals(Trigger.SUSTAIN_DISCOUNT, buildingCard.getAbilityTrigger());
        assertEquals(CharacterType.ARTIST, buildingCard.getEffectTarget());
    }


}