Fix: Building0Test, Building1Test, Building4Test
This commit is contained in:
@@ -50,6 +50,8 @@ class Building0Test {
|
||||
@Test
|
||||
@DisplayName("Testing clone method")
|
||||
void testClone() {
|
||||
int effectID = 0;
|
||||
EffectType effectType = EffectType.CARD_SET;
|
||||
int era = 1;
|
||||
int price = 1;
|
||||
int prestigeValue = 1;
|
||||
@@ -57,6 +59,8 @@ class Building0Test {
|
||||
|
||||
Building0 b1 = (Building0) b0.clone();
|
||||
|
||||
assertEquals(effectID, b1.getEffectId());
|
||||
assertEquals(effectType, b1.getEffectType());
|
||||
assertEquals(era, b1.getEra());
|
||||
assertEquals(price, b1.getPrice());
|
||||
assertEquals(prestigeValue, b1.getPrestigeValue());
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package it.polimi.ingsw.gc14.Model.Cards.Building.Effects;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
@@ -7,7 +9,11 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
class Building1Test {
|
||||
|
||||
@Test
|
||||
void getIcon() {
|
||||
// NO TEST NEEDED
|
||||
@DisplayName("Testing constructor and icon getter method")
|
||||
void testConstructorAndGetter() {
|
||||
CharacterType ct = CharacterType.INVENTOR;
|
||||
Building1 b0 = new Building1(1,2,3, ct);
|
||||
|
||||
assertEquals(ct, b0.getIcon());
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,29 @@
|
||||
package it.polimi.ingsw.gc14.Model.Cards.Building.Effects;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Cards.Building.EffectType;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters.Inventor;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class Building4Test {
|
||||
|
||||
@Test
|
||||
@DisplayName("Testing constructor")
|
||||
void testConstructor() {
|
||||
int era = 1;
|
||||
int price = 10;
|
||||
int prestigeValue = 5;
|
||||
|
||||
Building4 b0 = new Building4(era, price, prestigeValue);
|
||||
|
||||
assertEquals(EffectType.INVENTOR_PAIR, b0.getEffectType());
|
||||
assertEquals(4, b0.getEffectId());
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void buy() {
|
||||
Player p = new Player("test");
|
||||
@@ -23,6 +39,25 @@ class Building4Test {
|
||||
assertFalse(b4.buy(p));
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Testing clone method")
|
||||
void testClone() {
|
||||
int effectID = 4;
|
||||
EffectType effectType = EffectType.INVENTOR_PAIR;
|
||||
int era = 1;
|
||||
int price = 1;
|
||||
int prestigeValue = 1;
|
||||
Building4 b0 = new Building4(era, price,prestigeValue);
|
||||
|
||||
Building4 b1 = (Building4) b0.clone();
|
||||
|
||||
assertEquals(effectID, b1.getEffectId());
|
||||
assertEquals(effectType, b1.getEffectType());
|
||||
assertEquals(era, b1.getEra());
|
||||
assertEquals(price, b1.getPrice());
|
||||
assertEquals(prestigeValue, b1.getPrestigeValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void applyEffect() {
|
||||
Player p = new Player("test");
|
||||
|
||||
Reference in New Issue
Block a user