Delete ClientGameLogicTest.java

This commit is contained in:
Filip Szepielewicz 2024-12-13 13:50:30 +00:00
parent 97397e3053
commit e66487776d

View File

@ -1,123 +0,0 @@
package pp.monopoly.game.client;
/*
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import pp.monopoly.server.MonopolyServer;
import pp.monopoly.client.ClientSender;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.*;
/**
* Tests the client-side logic of the Monopoly game.
*/
/*
public class ClientGameLogicTest {
private ClientGameLogic logic;
@Mock
private MonopolyServer serverMock;
@Mock
private ClientSender clientSenderMock;
@Before
public void setUp() {
MockitoAnnotations.openMocks(this);
logic = new ClientGameLogic(clientSenderMock);
}
@Test
public void testEnterHostName() {
String hostName = "localhost";
logic.setHostName(hostName);
assertEquals("The hostname should be correctly set.", hostName, logic.getHostName());
}
@Test
public void testEnterPortNumber() {
int portNumber = 12345;
logic.setPortNumber(portNumber);
assertEquals("The port number should be correctly set.", portNumber, logic.getPortNumber());
}
@Test
public void testCancelGameCreation() {
doNothing().when(clientSenderMock).returnToMainMenu();
logic.cancelGameCreation();
verify(clientSenderMock, times(1)).returnToMainMenu();
}
@Test
public void testEnterPlayerLobby() {
doNothing().when(clientSenderMock).enterLobby();
logic.enterLobby();
verify(clientSenderMock, times(1)).enterLobby();
}
@Test
public void testEnterStartingCapital() {
int startingCapital = 1500;
logic.setStartingCapital(startingCapital);
assertEquals("The starting capital should be correctly set.", startingCapital, logic.getStartingCapital());
}
@Test
public void testIncreaseStartingCapital() {
logic.setStartingCapital(1500);
logic.increaseStartingCapital();
assertEquals("The starting capital should increase by 100.", 1600, logic.getStartingCapital());
}
@Test
public void testDecreaseStartingCapital() {
logic.setStartingCapital(1500);
logic.decreaseStartingCapital();
assertEquals("The starting capital should decrease by 100.", 1400, logic.getStartingCapital());
}
@Test
public void testDefaultPlayerName() {
logic.addPlayer("Player 1");
assertTrue("The player name should be correctly set.", logic.getPlayerNames().contains("Player 1"));
}
@Test
public void testEnterDisplayName() {
String displayName = "JohnDoe";
logic.setPlayerName(displayName);
assertEquals("The display name should be correctly set.", displayName, logic.getPlayerName());
}
@Test
public void testDuplicateNameEntry() {
logic.addPlayer("Player 1");
boolean result = logic.addPlayer("Player 1");
assertTrue("Duplicate names should not be allowed.", !result);
}
@Test
public void testSelectPlayerColor() {
logic.addPlayer("Player 1");
boolean result = logic.setPlayerColor("Player 1", "Red");
assertTrue("The player should be able to select an available color.", result);
}
}
*/