Mon, 27 Jul 2020 12:51:20 +0200
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();