Fix: Fixed "toString" Method Tests In CavePaintingsTest.java, HuntTest.java, ShamanicRitualTest.java, SustenanceTest.java.

Fix: Fixed "activateEvent" Method Tests In HuntTest.java, SustenanceTest.java.
Fix: Refactor In Sustenance.java.
This commit is contained in:
GabrieleRadice
2026-05-02 18:39:08 +02:00
parent a11f1e6741
commit 071752e256
5 changed files with 20 additions and 15 deletions
@@ -111,6 +111,6 @@ class CavePaintingsTest {
void toStringTest() {
CavePaintings cv1 = new CavePaintings(1, 1,1,1);
assertEquals("Era:1, CAVE_PAINTINGS", cv1.toString());
assertEquals("⎕:(Event)CAVE_PAINTINGS", cv1.toString());
}
}
@@ -41,8 +41,8 @@ class HuntTest {
new Hunter(1, false).insert(p2);
h1.activateEvent(players);
assertEquals(6, p1.getPrestigeValue());
assertEquals(2, p1.getFoodValue());
assertEquals(3*2, p1.getPrestigeValue());
assertEquals(1+2, p1.getFoodValue());
assertEquals(3, p2.getPrestigeValue());
assertEquals(1, p2.getFoodValue());
}
@@ -73,20 +73,25 @@ class HuntTest {
ArrayList<Player> players = new ArrayList<>(Arrays.asList(p1, p2, p3));
Hunt h1 = new Hunt(1, 3);
assertEquals(0, p1.getFoodValue());
new Hunter(1, true).insert(p1);
new Hunter(1, false).insert(p1);
new Hunter(1, false).insert(p2);
BuildingCard bc = new BuildingCard(7, 1, 5, 5);
p2.addFood(5);
bc.buy(p2);
assertEquals(5 - bc.getPrice(), p2.getFoodValue());
assertEquals(0, p2.getFoodValue());
new Hunter(1, false).insert(p3);
assertEquals(0, p3.getFoodValue());
h1.activateEvent(players);
assertEquals(6, p1.getPrestigeValue());
assertEquals(2, p1.getFoodValue());
assertEquals(3*2, p1.getPrestigeValue());
assertEquals(1 + 2, p1.getFoodValue());
assertEquals(4, p2.getPrestigeValue());
assertEquals(2, p2.getFoodValue());
assertEquals(3, p3.getPrestigeValue());
@@ -113,6 +118,6 @@ class HuntTest {
void toStringTest() {
Hunt h1 = new Hunt(1, 3);
assertEquals("Era:1, HUNT", h1.toString());
assertEquals("⎕:(Event)HUNT", h1.toString());
}
}
@@ -212,6 +212,6 @@ class ShamanicRitualTest {
void toStringTest() {
ShamanicRitual sr1 = new ShamanicRitual(1, 5,2);
assertEquals("Era:1, SHAMANIC_RITUAL", sr1.toString());
assertEquals("⎕:(Event)SHAMANIC_RITUAL", sr1.toString());
}
}
@@ -49,13 +49,13 @@ class SustenanceTest {
new Shaman(1, 5).insert(p1);
new Builder(1, 5, 5).insert(p1);
new Artist(1).insert(p1);
new Hunter(1, true).insert(p1);
new Hunter(1, false).insert(p1);
new Gatherer(1).insert(p1);
p2.addFood(1);
new Artist(1).insert(p2);
new Hunter(1, true).insert(p2);
new Hunter(1, true).insert(p2);
new Hunter(1, false).insert(p2);
new Hunter(1, false).insert(p2);
@@ -79,7 +79,7 @@ class SustenanceTest {
new Shaman(1, 5).insert(p1);
new Builder(1, 5, 5).insert(p1);
new Artist(1).insert(p1);
new Hunter(1, true).insert(p1);
new Hunter(1, false).insert(p1);
new Gatherer(1).insert(p1);
p2.addFood(2);
@@ -96,7 +96,7 @@ class SustenanceTest {
Sustenance s = new Sustenance(1,2);
s.activateEvent(players);
assertEquals(2, p1.getFoodValue());
assertEquals(3, p1.getFoodValue());
assertEquals(1, p2.getFoodValue());
assertEquals(0, p1.getPrestigeValue());
assertEquals(0, p2.getPrestigeValue());
@@ -122,7 +122,7 @@ class SustenanceTest {
void toStringTest() {
Sustenance s1 = new Sustenance(1, 5);
assertEquals("Era:1, SUSTENANCE", s1.toString());
assertEquals("⎕:(Event)SUSTENANCE", s1.toString());
}
}