@Test
  public void testOnSeekBarMovedChangesCOlor() {
    presenter.mBtService = service;
    presenter.onSeekBarMove(50, 100, 255);

    verify(service, times(1)).changeColor(colorCaptor.capture(), handlerCaptor.capture());
    assertPlutoColorEqual(50, 100, 255, colorCaptor.getValue());
  }
  @Test
  public void testOnSeekBarMovedOnSuccess() {
    presenter.mBtService = service;
    presenter.onSeekBarMove(50, 100, 255);
    verify(service, times(1)).changeColor(any(PlutoColor.class), handlerCaptor.capture());
    handlerCaptor.getValue().onSuccess();

    verify(view, times(1)).setBackgroundColor(colorCaptor.capture());
    assertPlutoColorEqual(50, 100, 255, colorCaptor.getValue());
  }
  @Test
  public void testOnSeekBarMovedOnError() {
    doReturn("app").when(service).getString(R.string.app_name);
    doReturn("write_error").when(service).getString(R.string.change_color_error);
    presenter.mBtService = service;
    presenter.onSeekBarMove(50, 100, 255);
    verify(service, times(1)).changeColor(any(PlutoColor.class), handlerCaptor.capture());
    handlerCaptor.getValue().onError();

    verify(baseView, times(1)).popUp("app", "write_error");
  }
  @Test
  public void testOnColorUpdate() {
    PlutoColor color = new PlutoColor(1, 2, 3);
    presenter.onColorUpdate(new PlutoCommunicator.ColorUpdateEvent(color));

    verify(view, times(1)).setBackgroundColor(color);
    verify(view, times(1)).setSeekBar(color);
  }
  @Test
  public void testBleResultHandlerError() {
    presenter.mBtService = service;
    doReturn("app").when(service).getString(R.string.app_name);
    doReturn("read_error").when(service).getString(R.string.read_color_error);
    presenter.mReadColorHandler.onError();

    verify(baseView, times(1)).popUp("app", "read_error");
  }
  @Test
  public void testOnServiceConnected() {
    presenter.onServiceConnected(mock(BluetoothService.class));

    verify(presenter.mBtService, times(1)).readColor(presenter.mReadColorHandler);
  }
  @Test
  public void testOnColorUpdateNullColor() {
    presenter.onColorUpdate(new PlutoCommunicator.ColorUpdateEvent(null));

    verifyZeroInteractions(view);
  }