Browse Source

test_Farbtest1 + Hilfklasse

remotes/origin/server
Paul Kattenborn 11 months ago
parent
commit
ea503cdf96
  1. 22
      src/test/java/ChatGUITest.java
  2. 10
      src/test/java/TestActionEvent.java

22
src/test/java/ChatGUITest.java

@ -0,0 +1,22 @@
import static org.junit.Assert.assertEquals;
import java.awt.Color;
import org.junit.Before;
import org.junit.Test;
public class ChatGUITest {
private ChatGUI chatGUI;
@Before
public void setUp() {
chatGUI = new ChatGUI();
}
@Test
public void testSetOutputTextColorRed() {
chatGUI.actionPerformed(new TestActionEvent(chatGUI.red));
assertEquals(Color.RED, chatGUI.outputTextArea.getForeground());
}
}

10
src/test/java/TestActionEvent.java

@ -0,0 +1,10 @@
import java.awt.event.ActionEvent;
public class TestActionEvent extends ActionEvent {
private static final long serialVersionUID = 1L;
public TestActionEvent(Object source) {
super(source, ActionEvent.ACTION_PERFORMED, "Test command");
}
}
Loading…
Cancel
Save