|
@ -2,6 +2,7 @@ import static org.junit.Assert.assertEquals; |
|
|
|
|
|
|
|
|
import java.awt.Color; |
|
|
import java.awt.Color; |
|
|
import java.awt.Font; |
|
|
import java.awt.Font; |
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
|
|
|
import org.junit.Before; |
|
|
import org.junit.Before; |
|
|
import org.junit.Test; |
|
|
import org.junit.Test; |
|
@ -61,6 +62,19 @@ public class ChatGUITest { |
|
|
String expectedOutput = "Testnachricht\n"; |
|
|
String expectedOutput = "Testnachricht\n"; |
|
|
assertEquals(expectedOutput, chatGUI.outputTextArea.getText()); |
|
|
assertEquals(expectedOutput, chatGUI.outputTextArea.getText()); |
|
|
} |
|
|
} |
|
|
|
|
|
@Test |
|
|
|
|
|
public void testInputTextFieldActionPerformed() { |
|
|
|
|
|
|
|
|
|
|
|
chatGUI.inputTextField.setText("Testnachricht"); |
|
|
|
|
|
chatGUI.actionPerformed(new ActionEvent(chatGUI.inputTextField, ActionEvent.ACTION_PERFORMED, "")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String expectedOutput = "Testnachricht\n"; |
|
|
|
|
|
assertEquals(expectedOutput, chatGUI.outputTextArea.getText()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertEquals("", chatGUI.inputTextField.getText()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|