Fixed: compilation errors
Added: line coverage improved
This commit is contained in:
@@ -2,6 +2,7 @@ package it.polimi.ingsw.gc14.Model.Orders;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -10,6 +11,16 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class Order2Test {
|
||||
|
||||
@Test
|
||||
@DisplayName("Testing Order2 constructor with wrong number of player")
|
||||
void constructorTest() {
|
||||
Player p1 = new Player("p1");
|
||||
ArrayList<Player> players = new ArrayList<>();
|
||||
players.add(p1);
|
||||
assertThrows(NoSuchElementException.class, () -> {new Order2(players);});
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
void firstReturnGetsFood() {
|
||||
Player p1 = new Player("p1");
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.polimi.ingsw.gc14.Model.Orders;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -10,6 +11,15 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class Order3Test {
|
||||
|
||||
@Test
|
||||
@DisplayName("Testing Order3 constructor with wrong number of player")
|
||||
void constructorTest() {
|
||||
Player p1 = new Player("p1");
|
||||
ArrayList<Player> players = new ArrayList<>();
|
||||
players.add(p1);
|
||||
assertThrows(NoSuchElementException.class, () -> {new Order3(players);});
|
||||
}
|
||||
|
||||
@Test
|
||||
void firstReturnGetsFood() {
|
||||
Player p1 = new Player("p1");
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.polimi.ingsw.gc14.Model.Orders;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -10,6 +11,15 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class Order4Test {
|
||||
|
||||
@Test
|
||||
@DisplayName("Testing Order4 constructor with wrong number of player")
|
||||
void constructorTest() {
|
||||
Player p1 = new Player("p1");
|
||||
ArrayList<Player> players = new ArrayList<>();
|
||||
players.add(p1);
|
||||
assertThrows(NoSuchElementException.class, () -> {new Order4(players);});
|
||||
}
|
||||
|
||||
@Test
|
||||
void firstReturnGetsFood() {
|
||||
Player p1 = new Player("p1");
|
||||
|
||||
@@ -2,6 +2,7 @@ package it.polimi.ingsw.gc14.Model.Orders;
|
||||
|
||||
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.*;
|
||||
@@ -15,6 +16,15 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class Order5Test {
|
||||
|
||||
@Test
|
||||
@DisplayName("Testing Order5 constructor with wrong number of player")
|
||||
void constructorTest() {
|
||||
Player p1 = new Player("p1");
|
||||
ArrayList<Player> players = new ArrayList<>();
|
||||
players.add(p1);
|
||||
assertThrows(NoSuchElementException.class, () -> {new Order5(players);});
|
||||
}
|
||||
|
||||
@Test
|
||||
void firstReturnGetsFood() {
|
||||
Player p1 = new Player("p1");
|
||||
|
||||
Reference in New Issue
Block a user