### Question:
DataTypeConstraintRange implements DataTypeConstraintComponent { @Override public String getValue() { return getRawValue(); } @Inject  DataTypeConstraintRange(final View view,
                                   final ConstraintPlaceholderHelper placeholderHelper,
                                   final DMNClientServicesProxy clientServicesProxy,
                                   final Event<DataTypeConstraintParserWarningEvent> parserWarningEvent); @Override String getValue(); @Override void setValue(final String value); @Override void setConstraintValueType(final String type); @Override Element getElement(); void setModal(final DataTypeConstraintModal modal);  }### Answer:
@Test public void testGetValueExcludeBoth() { when(view.getIncludeStartValue()).thenReturn(false); when(view.getStartValue()).thenReturn("1"); when(view.getEndValue()).thenReturn("6"); when(view.getIncludeEndValue()).thenReturn(false); final String expected = "(1..6)"; final String actual = constraintRange.getValue(); assertEquals(expected, actual); }
@Test public void testGetValueIncludeBoth() { when(view.getIncludeStartValue()).thenReturn(true); when(view.getStartValue()).thenReturn("1"); when(view.getEndValue()).thenReturn("6"); when(view.getIncludeEndValue()).thenReturn(true); final String expected = "[1..6]"; final String actual = constraintRange.getValue(); assertEquals(expected, actual); }
@Test public void testGetValueIncludeStartExcludeEnd() { when(view.getIncludeStartValue()).thenReturn(true); when(view.getStartValue()).thenReturn("1"); when(view.getEndValue()).thenReturn("6"); when(view.getIncludeEndValue()).thenReturn(false); final String expected = "[1..6)"; final String actual = constraintRange.getValue(); assertEquals(expected, actual); }
@Test public void testGetValueExcludeStartIncludeEnd() { when(view.getIncludeStartValue()).thenReturn(false); when(view.getStartValue()).thenReturn("1"); when(view.getEndValue()).thenReturn("6"); when(view.getIncludeEndValue()).thenReturn(true); final String expected = "(1..6]"; final String actual = constraintRange.getValue(); assertEquals(expected, actual); }
@Test public void testGetValue() { when(view.getIncludeStartValue()).thenReturn(true); when(view.getStartValue()).thenReturn("some_value"); when(view.getEndValue()).thenReturn("other_value"); when(view.getIncludeEndValue()).thenReturn(true); final String expected = "[some_value..other_value]"; final String actual = constraintRange.getValue(); assertEquals(expected, actual); }