added NetworkDialogClientTests

testEnterIP -> passes
testEnterPort -> can't be tested in model
testConnectToServer -> passes
testCantConnectToServer -> passes
testCancelJoining -> passes
This commit is contained in:
Timo Brennförder
2024-12-12 20:53:04 +01:00
parent 0d4685f3c2
commit 2ec9b3a246
5 changed files with 256 additions and 19 deletions

View File

@@ -11,6 +11,8 @@
import pp.mdga.notification.Notification;
import pp.mdga.notification.StartDialogNotification;
import java.lang.System.Logger;
import java.lang.System.Logger.Level;
import java.util.ArrayList;
import java.util.UUID;
@@ -19,7 +21,7 @@
* It is responsible for handling the game logic on the client side.
*/
public class ClientGameLogic implements ServerInterpreter {
static final System.Logger LOGGER = System.getLogger(ClientGameLogic.class.getName());
static final Logger LOGGER = System.getLogger(ClientGameLogic.class.getName());
private Game game;
private final ClientSender clientSender;
@@ -53,7 +55,7 @@ public ClientGameLogic(ClientSender clientSender) {
* @param msg the message to be sent
*/
public void send(ClientMessage msg) {
LOGGER.log(System.Logger.Level.INFO, "send {0}", msg);
LOGGER.log(Level.INFO, "send {0}", msg);
clientSender.send(msg);
}
@@ -581,7 +583,7 @@ public void selectLeave() {
/**
* This method calls the selectJoin method of the state
*
* @param ip the ip to cennect to
* @param ip the ip to connect to
*/
public void selectJoin(String ip) {
state.selectJoin(ip);