Add: PlayableCardTest, SlotTest
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
package it.polimi.ingsw.gc14.Model;
|
||||||
|
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCard;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class PlayableCardTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void PlayableCardWrongEraException() {
|
||||||
|
assertDoesNotThrow(() -> {
|
||||||
|
new BuildingCard(1, 5);
|
||||||
|
});
|
||||||
|
assertDoesNotThrow(() -> {
|
||||||
|
new BuildingCard(2, 5);
|
||||||
|
});
|
||||||
|
assertDoesNotThrow(() -> {
|
||||||
|
new BuildingCard(3, 5);
|
||||||
|
});
|
||||||
|
|
||||||
|
assertThrows(IllegalArgumentException.class, () -> {
|
||||||
|
new BuildingCard(0, 5);
|
||||||
|
});
|
||||||
|
assertThrows(IllegalArgumentException.class, () -> {
|
||||||
|
new BuildingCard(4, 5);
|
||||||
|
});
|
||||||
|
assertThrows(IllegalArgumentException.class, () -> {
|
||||||
|
new BuildingCard(-1, 5);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package it.polimi.ingsw.gc14.Model;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class SlotTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void SlotWrongArgument() { // TODO: Cos'è il parametro nMinPlayer? come va testato?
|
||||||
|
assertDoesNotThrow(() -> {
|
||||||
|
Slot sl1 = new Slot(0,0,1,1);
|
||||||
|
});
|
||||||
|
assertDoesNotThrow(() -> {
|
||||||
|
Slot sl1 = new Slot(0,1,0,1);
|
||||||
|
});
|
||||||
|
assertDoesNotThrow(() -> {
|
||||||
|
Slot sl1 = new Slot(1,0,0,1);
|
||||||
|
});
|
||||||
|
assertDoesNotThrow(() -> {
|
||||||
|
Slot sl1 = new Slot(1,1,0,1);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
assertThrows(IllegalArgumentException.class, () -> {
|
||||||
|
Slot sl1 = new Slot(1,0,1,1);
|
||||||
|
});
|
||||||
|
assertThrows(IllegalArgumentException.class, () -> {
|
||||||
|
Slot sl1 = new Slot(0,1,1,1);
|
||||||
|
});
|
||||||
|
assertThrows(IllegalArgumentException.class, () -> {
|
||||||
|
Slot sl1 = new Slot(1,1,1,1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user