ToolkitPresenter { public void onSourceCodeTextCursorMoved() { view.clearAstSelections(); AstNode astNode = view.getAstNodeFollowingCurrentSourceCodeTextCursorPosition(); view.selectAstNode(astNode); view.scrollAstTo(astNode); } ToolkitPresenter(ConfigurationModel configurationModel, SourceCodeModel model); void setView(ToolkitView view); void run(String title); void onSourceCodeOpenButtonClick(); void onSourceCodeParseButtonClick(); void onXPathEvaluateButtonClick(); void onSourceCodeKeyTyped(); void onSourceCodeTextCursorMoved(); void onAstSelectionChanged(); void onConfigurationPropertyFocusLost(String name);  }
@Test public void onSourceCodeTextCursorMoved() { ToolkitView view = mock(ToolkitView.class); AstNode astNode = mock(AstNode.class); when(view.getAstNodeFollowingCurrentSourceCodeTextCursorPosition()).thenReturn(astNode); ToolkitPresenter presenter = new ToolkitPresenter(mock(ConfigurationModel.class), mock(SourceCodeModel.class)); presenter.setView(view); presenter.onSourceCodeTextCursorMoved(); verify(view).clearAstSelections(); verify(view).selectAstNode(astNode); verify(view).scrollAstTo(astNode); }