public void testSetTextCanNotifyActionListeners() throws Exception { DummyActionListener actionListener = initWithTextFieldAndActionListener(); textBox.setText("text", false); assertEquals(0, actionListener.getCallCount()); UISpecAssert.assertTrue(textBox.textEquals("text")); textBox.setText("another text", true); assertEquals(1, actionListener.getCallCount()); UISpecAssert.assertTrue(textBox.textEquals("another text")); }
public void testSetTextNotifiesActionListenersForJTextField() throws Exception { DummyActionListener actionListener = initWithTextFieldAndActionListener(); textBox.setText("text"); assertEquals(1, actionListener.getCallCount()); }
public void testInsertTextDoesNotNotifyActionListeners() throws Exception { DummyActionListener actionListener = initWithTextFieldAndActionListener(); textBox.insertText("text", 0); assertEquals(0, actionListener.getCallCount()); }