@Test public void newlineIsTyped() throws Exception { model.setCaretLocation(TextLocation.origin); new CharTypedEvent(0, '\n').dispatch(panel); assertEquals("\nSome Text", model.getText()); }
@Test public void backspaceIsNotTyped() throws Exception { model.setCaretLocation(TextLocation.origin); new CharTypedEvent(0, '\b').dispatch(panel); assertEquals("Some Text", model.getText()); }
@Test public void typedCharsWithCommandModifierDoNothing() throws Exception { model.setCaretLocation(TextLocation.origin); new CharTypedEvent(KeyEvent.COMMAND_MASK, 'A').dispatch(panel); assertEquals("Some Text", model.getText()); }
@Test public void typingACharWillInsertIt() throws Exception { model.setCaretLocation(TextLocation.origin); new CharTypedEvent(0, 'Z').dispatch(panel); assertEquals("ZSome Text", model.getText()); }