I would like to create a JUnit Test Case that creates a case for every iteration of an array. How do I go about doing this? I've seen some docs about @Parameterized.Parameters but it seems like I will need to reconstruct my original array to look like {{array[0], constantValue}, {array[1], constantValue}}. Is there any way I can get JUnit to do the following:
public class Testing {
String[] array;
String constantValue;
@Test
public void test_arrayValue0() {
assertEquals(array[0] + " is true", true, method(array[0], constantValue));
}
@Test
public void test_arrayValue1() {
assertEquals(array[1] + "is true", true, method(array[1], constantValue));
}
@Test
public void test_arrayValue2() {
assertEquals(array[2] + " is true", true, method(array[2], constantValue));
}
//..until array is complete
}