Exemplo n.º 1
0
  @Test
  public void shouldDisableChangeButtonIfNoValue() throws Exception {
    when(view.getValue()).thenReturn(EMPTY_VALUE);

    presenter.onVariableValueChanged();

    verify(view).setEnableChangeButton(eq(DISABLE_BUTTON));
  }
Exemplo n.º 2
0
  @Test
  public void shouldEnableChangeButtonIfValueNotEmpty() throws Exception {
    when(view.getValue()).thenReturn(VAR_VALUE);

    presenter.onVariableValueChanged();

    verify(view).setEnableChangeButton(eq(!DISABLE_BUTTON));
  }
Exemplo n.º 3
0
  @Test
  public void testChangeValueRequest() throws Exception {
    when(debuggerManager.getActiveDebugger()).thenReturn(debugger);
    when(view.getValue()).thenReturn(VAR_VALUE);
    when(debuggerVariable.getVariablePath()).thenReturn(variablePath);
    when(variablePath.getPath()).thenReturn(new ArrayList<>());

    presenter.onChangeClicked();

    verify(debugger).changeVariableValue(anyObject(), anyString());
    verify(view).close();
  }