Add: Added applyEffect Method Test In Building1Test.java.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package it.polimi.ingsw.gc14.Model.Cards.Building.Effects;
|
package it.polimi.ingsw.gc14.Model.Cards.Building.Effects;
|
||||||
|
|
||||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Player;
|
||||||
import org.junit.jupiter.api.DisplayName;
|
import org.junit.jupiter.api.DisplayName;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
@@ -16,4 +17,35 @@ class Building1Test {
|
|||||||
|
|
||||||
assertEquals(ct, b0.getIcon());
|
assertEquals(ct, b0.getIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Apply Effect")
|
||||||
|
void applyEffect(){
|
||||||
|
String user = "test";
|
||||||
|
Player p = new Player(user);
|
||||||
|
assertTrue(p.buildingCards.isEmpty());
|
||||||
|
assertTrue(p.inventors.isEmpty());
|
||||||
|
assertTrue(p.builders.isEmpty());
|
||||||
|
assertTrue(p.gatherers.isEmpty());
|
||||||
|
assertTrue(p.shamans.isEmpty());
|
||||||
|
assertTrue(p.hunters.isEmpty());
|
||||||
|
assertTrue(p.artists.isEmpty());
|
||||||
|
assertEquals(0, p.getFoodValue());
|
||||||
|
assertEquals(0, p.getPrestigeValue());
|
||||||
|
assertEquals(user, p.getUserName());
|
||||||
|
|
||||||
|
Building1 b0 = new Building1(1,2,3, CharacterType.INVENTOR);
|
||||||
|
b0.applyEffect(p);
|
||||||
|
|
||||||
|
assertTrue(p.buildingCards.isEmpty());
|
||||||
|
assertTrue(p.inventors.isEmpty());
|
||||||
|
assertTrue(p.builders.isEmpty());
|
||||||
|
assertTrue(p.gatherers.isEmpty());
|
||||||
|
assertTrue(p.shamans.isEmpty());
|
||||||
|
assertTrue(p.hunters.isEmpty());
|
||||||
|
assertTrue(p.artists.isEmpty());
|
||||||
|
assertEquals(0, p.getFoodValue());
|
||||||
|
assertEquals(0, p.getPrestigeValue());
|
||||||
|
assertEquals(user, p.getUserName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user