Building13 test added
This commit is contained in:
@@ -18,4 +18,8 @@ public class Building13 extends BuildingCard{
|
||||
public void applyEffect(Player player) {
|
||||
player.addPrestige(25);
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Era:"+String.valueOf(getEra())+"\nPrice:"+String.valueOf(getPrice())+"\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,12 @@ public abstract class PlayableCard {
|
||||
public int getEra(){
|
||||
return Era;
|
||||
}
|
||||
public PlayableCard (int Era){
|
||||
public PlayableCard (int Era) throws IllegalArgumentException{
|
||||
if (Era>0 && Era<4) {
|
||||
this.Era = Era;
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package it.polimi.ingsw.gc14.Model.Cards.Building.Effects;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class Building13Test {
|
||||
|
||||
|
||||
@Test
|
||||
void testClone() {
|
||||
assertThrows(IllegalArgumentException.class, () -> {
|
||||
Building13 b2 = new Building13(0, 15);
|
||||
Building13 b3 = new Building13(-1, 100);
|
||||
Building13 b4 = new Building13(5, -10);
|
||||
Building13 b5 = new Building13(-2, 0);
|
||||
});
|
||||
|
||||
Building13 b1 = new Building13(1, 10);
|
||||
assertEquals(1, b1.getEra());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
void applyEffect() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user