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

changeset 16
bddb2633c98b
parent 13
5e69b1bb707f
child 17
aad33a4db18d
equal deleted inserted replaced
15:fea6eaa0d520 16:bddb2633c98b
125 assertEquals("4", tf.getText()); 125 assertEquals("4", tf.getText());
126 }); 126 });
127 } 127 }
128 128
129 @Test 129 @Test
130 void testNumpad() throws InvocationTargetException, InterruptedException {
131 // given
132 final var tf = createTestSubject();
133 assertEquals("", tf.getText());
134 final var event = new KeyEvent(tf, KeyEvent.KEY_PRESSED, System.currentTimeMillis(),
135 0, KeyEvent.VK_NUMPAD4, '4');
136 SwingUtilities.invokeAndWait(() -> {
137 // when
138 dispatch(tf, event);
139 // then
140 assertEquals("4", tf.getText());
141 });
142 }
143
144 @Test
130 void testTextOverwriteByKeystore() throws InvocationTargetException, InterruptedException { 145 void testTextOverwriteByKeystore() throws InvocationTargetException, InterruptedException {
131 // given 146 // given
132 final var tf = createTestSubject(); 147 final var tf = createTestSubject();
133 tf.setText("6"); 148 tf.setText("6");
134 tf.selectAll(); 149 tf.selectAll();

mercurial