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,64 @@
package Server;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
class OfferingTileTest {
OfferingTile offeringTile;
@Test
void isEmpty() {
//test the ability of the method to recognize an occupied tile
OfferingTile offeringTile = new OfferingTile(4);
assertTrue(offeringTile.isEmpty());
}
@BeforeEach
public void init(){
offeringTile = new OfferingTile(4);
offeringTile.setOccupant(new Player("Johnny", TotemColor.BLUE));
}
@Test
void RemoveOccupant(){
//test that the occupant has been removed
assertNull(offeringTile.removeOccupant());
}
@Test
void GetOccupant(){
assertEquals("Johnny",offeringTile.getOccupant().getNickname());
}
@Test
void SetOccupant(){
//test that the player has been set
assertEquals("Johnny",offeringTile.getOccupant().getNickname());
}
@Test
void getActions(){
//tests that the actions associated to tile are the correct ones
OfferingTile offeringTile = new OfferingTile(4);
List<Symbol> correct = List.of(Symbol.DOWN,Symbol.UP);
assertEquals(correct,offeringTile.getActions());
}
}