|
|
@@ -12,27 +12,27 @@ import static org.junit.Assert.assertEquals;
|
|
12
|
12
|
@RunWith(Parameterized.class)
|
|
13
|
13
|
public class PrimeFactorsTest {
|
|
14
|
14
|
|
|
15
|
|
- private double input;
|
|
16
|
|
- private List<Integer> expectedOutput;
|
|
|
15
|
+ private long input;
|
|
|
16
|
+ private List<Long> expectedOutput;
|
|
17
|
17
|
|
|
18
|
|
- @Parameters
|
|
|
18
|
+ @Parameters(name="Prime factors of {0} = {1}")
|
|
19
|
19
|
public static Collection<Object[]> data() {
|
|
20
|
20
|
return Arrays.asList(new Object[][]{
|
|
21
|
|
- {1, Arrays.asList(new Integer[0])},
|
|
22
|
|
- {2, Arrays.asList(new Integer[]{2})},
|
|
23
|
|
- {3, Arrays.asList(new Integer[]{3})},
|
|
24
|
|
- {4, Arrays.asList(new Integer[]{2, 2})},
|
|
25
|
|
- {6, Arrays.asList(new Integer[]{2, 3})},
|
|
26
|
|
- {8, Arrays.asList(new Integer[]{2, 2, 2})},
|
|
27
|
|
- {9, Arrays.asList(new Integer[]{3, 3})},
|
|
28
|
|
- {27, Arrays.asList(new Integer[]{3, 3, 3})},
|
|
29
|
|
- {625, Arrays.asList(new Integer[]{5, 5, 5, 5})},
|
|
30
|
|
- {901255, Arrays.asList(new Integer[]{5, 17, 23, 461})},
|
|
31
|
|
- {93819012551L, Arrays.asList(new Integer[]{11, 9539, 894119})}
|
|
|
21
|
+ {1L, Arrays.asList()},
|
|
|
22
|
+ {2L, Arrays.asList(2L)},
|
|
|
23
|
+ {3L, Arrays.asList(3L)},
|
|
|
24
|
+ {4L, Arrays.asList(2L, 2L)},
|
|
|
25
|
+ {6L, Arrays.asList(2L, 3L)},
|
|
|
26
|
+ {8L, Arrays.asList(2L, 2L, 2L)},
|
|
|
27
|
+ {9L, Arrays.asList(3L, 3L)},
|
|
|
28
|
+ {27L, Arrays.asList(3L, 3L, 3L)},
|
|
|
29
|
+ {625L, Arrays.asList(5L, 5L, 5L, 5L)},
|
|
|
30
|
+ {901255L, Arrays.asList(5L, 17L, 23L, 461L)},
|
|
|
31
|
+ {93819012551L, Arrays.asList(11L, 9539L, 894119L)}
|
|
32
|
32
|
});
|
|
33
|
33
|
}
|
|
34
|
34
|
|
|
35
|
|
- public PrimeFactorsTest(double input, List<Integer> expectedOutput) {
|
|
|
35
|
+ public PrimeFactorsTest(long input, List<Long> expectedOutput) {
|
|
36
|
36
|
this.input = input;
|
|
37
|
37
|
this.expectedOutput = expectedOutput;
|
|
38
|
38
|
}
|