src/test/java/de/uapcore/sudoku/SudokuTextFieldTest.java

changeset 22
06170a0be62a
parent 19
627e1c99bcf1
--- a/src/test/java/de/uapcore/sudoku/SudokuTextFieldTest.java	Tue Jul 28 14:05:04 2020 +0200
+++ b/src/test/java/de/uapcore/sudoku/SudokuTextFieldTest.java	Tue Jul 28 14:27:14 2020 +0200
@@ -1,6 +1,5 @@
 package de.uapcore.sudoku;
 
-
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -244,4 +243,37 @@
         // then
         SwingUtilities.invokeAndWait(() -> assertNull(tf.getSelectedText()));
     }
-}
\ No newline at end of file
+
+    @Test
+    void testFont() {
+        final var tf = new SudokuTextField();
+        assertEquals(18, tf.getFont().getSize());
+    }
+
+    @Test
+    void testAlignment() {
+        final var tf = new SudokuTextField();
+        assertEquals(JTextField.CENTER, tf.getHorizontalAlignment());
+    }
+
+    @Test
+    void testBackground() {
+        final var tf = new SudokuTextField();
+        assertEquals(Color.WHITE, tf.getBackground());
+    }
+
+    @Test
+    void testSize() {
+        final var tf = new SudokuTextField();
+        final var expected = new Dimension(40, 40);
+        assertEquals(expected, tf.getMinimumSize());
+        assertEquals(expected, tf.getPreferredSize());
+        assertEquals(expected, tf.getMaximumSize());
+    }
+
+    @Test
+    void testBorder() {
+        final var tf = new SudokuTextField();
+        assertNull(tf.getBorder());
+    }
+}

mercurial