adds numpad test

Mon, 27 Jul 2020 12:51:20 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 27 Jul 2020 12:51:20 +0200
changeset 16
bddb2633c98b
parent 15
fea6eaa0d520
child 17
aad33a4db18d

adds numpad test

src/test/java/de/uapcore/sudoku/SudokuTextFieldTest.java file | annotate | diff | comparison | revisions
--- a/src/test/java/de/uapcore/sudoku/SudokuTextFieldTest.java	Mon Jul 27 12:08:23 2020 +0200
+++ b/src/test/java/de/uapcore/sudoku/SudokuTextFieldTest.java	Mon Jul 27 12:51:20 2020 +0200
@@ -127,6 +127,21 @@
     }
 
     @Test
+    void testNumpad() throws InvocationTargetException, InterruptedException {
+        // given
+        final var tf = createTestSubject();
+        assertEquals("", tf.getText());
+        final var event = new KeyEvent(tf, KeyEvent.KEY_PRESSED, System.currentTimeMillis(),
+                0, KeyEvent.VK_NUMPAD4, '4');
+        SwingUtilities.invokeAndWait(() -> {
+            // when
+            dispatch(tf, event);
+            // then
+            assertEquals("4", tf.getText());
+        });
+    }
+
+    @Test
     void testTextOverwriteByKeystore() throws InvocationTargetException, InterruptedException {
         // given
         final var tf = createTestSubject();

mercurial