Fix: Fixed Various "toString" Method Issues + Relative Tests.

This commit is contained in:
GabrieleRadice
2026-04-29 16:39:26 +02:00
parent c3bdcdcc36
commit 87d7cf6a5f
9 changed files with 31 additions and 10 deletions
@@ -1,6 +1,6 @@
package it.polimi.ingsw.gc14.Model;
import it.polimi.ingsw.gc14.Model.Cards.Building.Effects.Building1;
import it.polimi.ingsw.gc14.Model.Cards.Building.Effects.*;
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters.*;
@@ -218,6 +218,27 @@ class PlayerTest {
p.buildingCards.add(new BuildingCard(2, 1,2, 5));
p.buildingCards.add(new BuildingCard(2, 2,3, 6));
p.buildingCards.add(new Building1(2, 5, 5, CharacterType.INVENTOR));
System.out.println(p.toString());
p.buildingCards.add(new Building1(2, 5, 5, CharacterType.SHAMAN));
p.buildingCards.add(new Building11(1, 5, 7, CharacterType.ARTIST , 3));
//System.out.println(p.toString());
assertEquals(""+
"╔═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗\n" +
"║ test_usr ║\n" +
"├═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════┤\n" +
"║ RESOURCES: ║\n" +
"║ Food: 7 ║\n" +
"║ Prestige: 15 ║\n" +
"├═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════┤\n" +
"║ CHARACTERS: ║\n" +
"║ Artists: [⎕:, ⎕:, ⎕:, ⎕:, ⎕:, ⎕:, ⎕:] ║\n" +
"║ Builders: [⎕: RV:5 PV:1] ║\n" +
"║ Gatherers: [⎕:] ║\n" +
"║ Shamans: [⎕: *:3, ⎕: *:3] ║\n" +
"║ Inventors: [⎕: I_ID:1] ║\n" +
"║ Hunters: [⎕: I, ⎕:] ║\n" +
"├═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════┤\n" +
"║ BUILDING CARDS: ║\n" +
"║ Buildings: [⎕: ID:2 $:2 PV:5, ⎕: ID:2 $:3 PV:6, ⎕: ID:1 $:5 PV:5 Icon: I, ⎕: ID:1 $:5 PV:5 Icon: S, ⎕: ID:11 $:5 PV:7 Icon: A MP: 3]║\n" +
"╚═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝", p.toString());
}
}