ShadowNumberPicker should not check for array lengths.
Closes #1655.
diff --git a/robolectric-shadows/shadows-core/src/main/java/org/robolectric/shadows/ShadowNumberPicker.java b/robolectric-shadows/shadows-core/src/main/java/org/robolectric/shadows/ShadowNumberPicker.java
index 8cc057d..8040c4d 100644
--- a/robolectric-shadows/shadows-core/src/main/java/org/robolectric/shadows/ShadowNumberPicker.java
+++ b/robolectric-shadows/shadows-core/src/main/java/org/robolectric/shadows/ShadowNumberPicker.java
@@ -30,9 +30,6 @@
@Implementation
public void setDisplayedValues(String[] displayedValues) {
- if (displayedValues != null && displayedValues.length != (maxValue - minValue) + 1) {
- throw new RuntimeException("Displayed values should fit into range min and max values");
- }
this.displayedValues = displayedValues;
}
diff --git a/robolectric/src/test/java/org/robolectric/shadows/ShadowNumberPickerTest.java b/robolectric/src/test/java/org/robolectric/shadows/ShadowNumberPickerTest.java
index 9e9b972..8fe5195 100644
--- a/robolectric/src/test/java/org/robolectric/shadows/ShadowNumberPickerTest.java
+++ b/robolectric/src/test/java/org/robolectric/shadows/ShadowNumberPickerTest.java
@@ -8,6 +8,8 @@
import org.robolectric.Shadows;
import org.robolectric.TestRunners;
+import java.text.DateFormatSymbols;
+
import static junit.framework.Assert.fail;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@@ -16,29 +18,6 @@
public class ShadowNumberPickerTest {
@Test
- public void setDisplayedValues_shouldCheckArraySize() throws Exception {
- NumberPicker picker = new NumberPicker(RuntimeEnvironment.application);
- picker.setMaxValue(2);
- picker.setDisplayedValues(null);
-
- try {
- picker.setDisplayedValues(new String[] {"0", "1"});
- fail("should have complained about being too small");
- } catch (Exception e) {
- // pass
- }
-
- picker.setDisplayedValues(new String[] {"0", "1", "2"});
-
- try {
- picker.setDisplayedValues(new String[] {"0", "1", "2", "3"});
- fail("should have complained about being too big");
- } catch (Exception e) {
- // pass
- }
- }
-
- @Test
public void shouldFireListeners() {
NumberPicker picker = new NumberPicker(RuntimeEnvironment.application);