From 0f07791c8751fb50b9f55a48784cd21b07d36879 Mon Sep 17 00:00:00 2001 From: Paul Kattenborn Date: Fri, 9 Feb 2024 03:46:31 +0100 Subject: [PATCH] test_ButtonTest --- src/test/java/ChatGUITest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/ChatGUITest.java b/src/test/java/ChatGUITest.java index 42065b8..04fa7d0 100644 --- a/src/test/java/ChatGUITest.java +++ b/src/test/java/ChatGUITest.java @@ -53,6 +53,14 @@ public class ChatGUITest { Font expectedFont = chatGUI.outputTextArea.getFont().deriveFont(Font.PLAIN, 20); assertEquals(expectedFont, chatGUI.outputTextArea.getFont()); } + @Test + public void testSendButtonActionPerformed() { + chatGUI.inputTextField.setText("Testnachricht"); + chatGUI.sendButton.doClick(); + + String expectedOutput = "Testnachricht\n"; + assertEquals(expectedOutput, chatGUI.outputTextArea.getText()); + } }