Fix: update Order tests
This commit is contained in:
@@ -68,7 +68,7 @@ class Order3Test {
|
||||
}
|
||||
|
||||
@Test
|
||||
void thirdReturnPaysFoodAndLosesPrestige() {
|
||||
void thirdReturnPaysFoodWithoutLosingPrestige() {
|
||||
Player p1 = new Player("p1");
|
||||
Player p2 = new Player("p2");
|
||||
Player p3 = new Player("p3");
|
||||
@@ -89,33 +89,7 @@ class Order3Test {
|
||||
order.push(thirdToAct);
|
||||
|
||||
assertEquals(0, thirdToAct.getFoodValue());
|
||||
assertEquals(-2, thirdToAct.getPrestigeValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void thirdReturnWithoutFoodNoEffect() {
|
||||
Player p1 = new Player("p1");
|
||||
Player p2 = new Player("p2");
|
||||
Player p3 = new Player("p3");
|
||||
ArrayList<Player> players = new ArrayList<>();
|
||||
players.add(p1);
|
||||
players.add(p2);
|
||||
players.add(p3);
|
||||
Order3 order = new Order3(players);
|
||||
|
||||
Player firstToAct = order.pull();
|
||||
Player secondToAct = order.pull();
|
||||
Player thirdToAct = order.pull();
|
||||
|
||||
int initialFood = thirdToAct.getFoodValue();
|
||||
int initialPrestige = thirdToAct.getPrestigeValue();
|
||||
|
||||
order.push(firstToAct);
|
||||
order.push(secondToAct);
|
||||
order.push(thirdToAct);
|
||||
|
||||
assertEquals(initialFood, thirdToAct.getFoodValue());
|
||||
assertEquals(initialPrestige, thirdToAct.getPrestigeValue());
|
||||
assertEquals(0, thirdToAct.getPrestigeValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -101,7 +101,7 @@ class Order4Test {
|
||||
}
|
||||
|
||||
@Test
|
||||
void fourthReturnPaysFoodAndLosesPrestige() {
|
||||
void fourthReturnPaysFoodWithoutLosingPrestige() {
|
||||
Player p1 = new Player("p1");
|
||||
Player p2 = new Player("p2");
|
||||
Player p3 = new Player("p3");
|
||||
@@ -126,11 +126,11 @@ class Order4Test {
|
||||
order.push(fourthToAct);
|
||||
|
||||
assertEquals(0, fourthToAct.getFoodValue());
|
||||
assertEquals(-2, fourthToAct.getPrestigeValue());
|
||||
assertEquals(0, fourthToAct.getPrestigeValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void fourthReturnWithoutFoodNoEffect() {
|
||||
void fourthReturnWithoutFoodLosesPrestige() {
|
||||
Player p1 = new Player("p1");
|
||||
Player p2 = new Player("p2");
|
||||
Player p3 = new Player("p3");
|
||||
@@ -156,7 +156,7 @@ class Order4Test {
|
||||
order.push(fourthToAct);
|
||||
|
||||
assertEquals(initialFood, fourthToAct.getFoodValue());
|
||||
assertEquals(initialPrestige, fourthToAct.getPrestigeValue());
|
||||
assertEquals(initialPrestige - 2, fourthToAct.getPrestigeValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -5,13 +5,10 @@ import it.polimi.ingsw.gc14.Model.Player;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class Order5Test {
|
||||
@@ -148,7 +145,7 @@ class Order5Test {
|
||||
}
|
||||
|
||||
@Test
|
||||
void fifthReturnPaysFoodAndLosesPrestige() {
|
||||
void fifthReturnPaysFoodWithoutLosingPrestige() {
|
||||
Player p1 = new Player("p1");
|
||||
Player p2 = new Player("p2");
|
||||
Player p3 = new Player("p3");
|
||||
@@ -177,11 +174,11 @@ class Order5Test {
|
||||
order.push(fifthToAct);
|
||||
|
||||
assertEquals(0, fifthToAct.getFoodValue());
|
||||
assertEquals(-2, fifthToAct.getPrestigeValue());
|
||||
assertEquals(0, fifthToAct.getPrestigeValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
void fifthReturnWithoutFoodNoEffect() {
|
||||
void fifthReturnWithoutFoodLosesPrestige() {
|
||||
Player p1 = new Player("p1");
|
||||
Player p2 = new Player("p2");
|
||||
Player p3 = new Player("p3");
|
||||
@@ -211,7 +208,7 @@ class Order5Test {
|
||||
order.push(fifthToAct);
|
||||
|
||||
assertEquals(initialFood, fifthToAct.getFoodValue());
|
||||
assertEquals(initialPrestige, fifthToAct.getPrestigeValue());
|
||||
assertEquals(initialPrestige - 2, fifthToAct.getPrestigeValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user