|
@@ -13,6 +13,20 @@ public class PrimeFactorsCalculatorTest {
|
|
|
test(EMPTY_LIST,1);
|
|
test(EMPTY_LIST,1);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
|
+ void testGetFactorsValues2() {
|
|
|
|
|
+ test(List.of(2, 2), 4);
|
|
|
|
|
+ test(List.of(2), 2);
|
|
|
|
|
+ test(List.of(3), 3);
|
|
|
|
|
+ test(List.of(2, 2), 4);
|
|
|
|
|
+ test(List.of(5), 5);
|
|
|
|
|
+ test(List.of(2, 3), 6);
|
|
|
|
|
+ test(List.of(7), 7);
|
|
|
|
|
+ test(List.of(2, 2, 2), 8);
|
|
|
|
|
+ test(List.of(3, 3), 9);
|
|
|
|
|
+ test(List.of(2, 5), 10);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void test(List<Integer> l, int n) {
|
|
private void test(List<Integer> l, int n) {
|
|
|
List<Integer> factors = calculator.getFactors(n);
|
|
List<Integer> factors = calculator.getFactors(n);
|
|
|
assertIterableEquals(l, factors);
|
|
assertIterableEquals(l, factors);
|