Fix: ShamanicRituals, Building13Test. Add: Building11Test
This commit is contained in:
+4
-2
@@ -24,11 +24,13 @@ public class ShamanicRitual extends EventCard {
|
||||
public void activateEvent (ArrayList <Player> playerList){
|
||||
Map<Player, Integer> playerMap = new HashMap<>();
|
||||
int tmpIcons = 0;
|
||||
int tmpCount = 0;
|
||||
|
||||
for (Player player : playerList) {
|
||||
tmpIcons = player.shamans.stream().mapToInt(sh -> sh.getIcon()).sum();
|
||||
if (player.buildingCards.stream().anyMatch(b -> b.getEffectId() == 5)) {
|
||||
tmpIcons = tmpIcons+3;
|
||||
tmpCount = (int) player.buildingCards.stream().filter(b -> b.getEffectId() == 5).count();
|
||||
if (tmpCount > 1) {
|
||||
tmpIcons = tmpIcons+(3*tmpCount);
|
||||
}
|
||||
playerMap.put(player, tmpIcons);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package it.polimi.ingsw.gc14.Model.Cards.Building.Effects;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class Building11Test {
|
||||
|
||||
@Test
|
||||
void Building11() {
|
||||
}
|
||||
|
||||
@Test
|
||||
void applyEffect() {
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ class Building13Test {
|
||||
|
||||
|
||||
@Test
|
||||
void testClone() {
|
||||
void Building13() {
|
||||
assertThrows(IllegalArgumentException.class, () -> {
|
||||
Building13 b2 = new Building13(0, 15);
|
||||
});
|
||||
@@ -33,9 +33,15 @@ class Building13Test {
|
||||
Building13 b1 = new Building13(1, 10);
|
||||
assertEquals(1, b1.getEra());
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void applyEffect() {
|
||||
Player p1 = new Player("gigi");
|
||||
p1.addPrestige(10);
|
||||
Building13 b1 = new Building13(1, 10);
|
||||
b1.applyEffect(p1);
|
||||
assertEquals(35, p1.getPrestigeValue());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user