Initial commit of Mesos Java project

This commit is contained in:
2026-04-13 09:46:34 +02:00
commit f9d40590f8
76 changed files with 6785 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package Server.Cards;
import Server.Utils.LoadingCardsException;
import org.junit.jupiter.api.Test;
import static Server.Era.I;
import static org.junit.jupiter.api.Assertions.*;
class CharacterCardTest {
//Test if the method parsRow is able to create a correct CharacterCard
@Test
void parsRow() {
CharacterCard characterCard = CharacterCard.parsRow("C;1;2;I;SHAMAN;3;4");
assertEquals(1, characterCard.getCardId());
assertEquals(2, characterCard.getForMinPlayer());
assertEquals(I, characterCard.getEra());
assertEquals(CharacterType.SHAMAN, characterCard.getCharacterType());
assertEquals(3, characterCard.getIconValue());
assertEquals(4, characterCard.getPrestigePoints());
}
//Tests if the method parsRow send an exception with the message "Not a character" when is given
//as an input the wrong type of card
@Test
void wrongTypeOfCard(){
Exception exception = assertThrows(LoadingCardsException.class, () -> CharacterCard.parsRow("B;1;2;I;3;1;SHAMANIC_RITUAL"));
String actualMessage = exception.getMessage();
assertTrue(actualMessage.contains("Not a character card"));
}
}