### Question:
DataTypeConstraintRangeView implements DataTypeConstraintRange.View { void onValueChanged(final Object event) { if (StringUtils.isEmpty(startValueComponent.getValue()) || StringUtils.isEmpty(endValueComponent.getValue())) { presenter.disableOkButton(); } else { presenter.enableOkButton(); } } @Inject  DataTypeConstraintRangeView(final HTMLDivElement startValueContainer,
                                       final HTMLDivElement endValueContainer,
                                       final HTMLInputElement includeStartValue,
                                       final HTMLInputElement includeEndValue,
                                       final TypedValueComponentSelector startValueComponentSelector,
                                       final TypedValueComponentSelector endValueComponentSelector); @Override void init(final DataTypeConstraintRange presenter); @Override String getStartValue(); @Override String getEndValue(); @Override void setStartValue(final String value); @Override void setEndValue(final String value); @Override boolean getIncludeStartValue(); @Override void setIncludeStartValue(boolean includeStartValue); @Override boolean getIncludeEndValue(); @Override void setIncludeEndValue(boolean includeEndValue); @Override void setPlaceholders(final String placeholder); @Override void setComponentSelector(final String type);  }### Answer:
@Test public void testOnKeyUpEmptyValues() { when(startValueComponent.getValue()).thenReturn(""); when(endValueComponent.getValue()).thenReturn(""); view.onValueChanged(event); verify(presenter).disableOkButton(); verify(presenter, never()).enableOkButton(); }
@Test public void testOnKeyUpNonEmptyValues() { when(startValueComponent.getValue()).thenReturn("1"); when(endValueComponent.getValue()).thenReturn("2"); view.onValueChanged(event); verify(presenter).enableOkButton(); verify(presenter, never()).disableOkButton(); }
@Test public void testOnKeyUpNonEmptyStartValue() { when(startValueComponent.getValue()).thenReturn("123456"); when(endValueComponent.getValue()).thenReturn(""); view.onValueChanged(event); verify(presenter).disableOkButton(); verify(presenter, never()).enableOkButton(); }
@Test public void testOnKeyUpNonEmptyEndValue() { when(startValueComponent.getValue()).thenReturn(""); when(endValueComponent.getValue()).thenReturn("123456"); view.onValueChanged(event); verify(presenter).disableOkButton(); verify(presenter, never()).enableOkButton(); }