Fix: Building11Test
This commit is contained in:
+39
-4
@@ -1,16 +1,51 @@
|
|||||||
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.Characters.Artist;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters.Hunter;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Player;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType.ARTIST;
|
||||||
|
import static it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType.HUNTER;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
class Building11Test {
|
class Building11Test {
|
||||||
|
|
||||||
@Test
|
|
||||||
void Building11() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void applyEffect() {
|
void applyEffect() {
|
||||||
|
|
||||||
|
Player p1 = new Player("Xiaomi");
|
||||||
|
Building11 b1 = new Building11(2, 10, ARTIST, -3);
|
||||||
|
Artist a1 = new Artist(2);
|
||||||
|
b1.buy(p1);
|
||||||
|
p1.artists.add(a1);
|
||||||
|
|
||||||
|
assertThrows(IllegalArgumentException.class, () -> {
|
||||||
|
b1.applyEffect(p1);
|
||||||
|
});
|
||||||
|
p1.buildingCards.add(b1);
|
||||||
|
b1.applyEffect(p1);
|
||||||
|
assertEquals(-3, p1.getPrestigeValue());
|
||||||
|
|
||||||
|
|
||||||
|
Player p2 = new Player("Giacomo");
|
||||||
|
Building11 b2 = new Building11(2, 10, ARTIST, 4);
|
||||||
|
Artist a2 = new Artist(2);
|
||||||
|
Artist a3 = new Artist(2);
|
||||||
|
b2.buy(p2);
|
||||||
|
p2.artists.add(a2);
|
||||||
|
p2.artists.add(a3);
|
||||||
|
|
||||||
|
p2.buildingCards.add(b2);
|
||||||
|
b2.applyEffect(p2);
|
||||||
|
assertEquals(8, p2.getPrestigeValue());
|
||||||
|
|
||||||
|
|
||||||
|
Building11 b3 = new Building11(1, 15, HUNTER, 5);
|
||||||
|
b3.buy(p1);
|
||||||
|
assertEquals(false, b3.buy(p2));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user