コード例 #1
0
  @Test
  public void editorNodeShouldBeUpdated() {
    editorAgent.openEditor(file, callback);

    editorAgent.updateEditorNode(PATH, newFileNode);

    verify(editor, times(2)).getEditorInput();
    verify(editorInput).setFile(newFileNode);
    verify(editor).onFileChanged();

    assertThat(editorAgent.getOpenedEditors().contains(editor), is(true));
  }
コード例 #2
0
  @Test
  public void editorNodeShouldNotBeUpdatedBecauseFileIsNotOpened() {
    editorAgent.updateEditorNode(PATH, newFileNode);

    verifyNoMoreInteractions(editor, newFileNode, editorInput);
  }