This comment is hidden because it contains spoiler information about the solution
The Submit tests only test for the element at index 1 when the input array is null - it should also check that the element at index 0 is 0 in that case.
null
0
As far as the current test goes I can return new int[] {1, 1331, 2, 3, 4, -1, 0} and the test will still consider my result correct.
new int[] {1, 1331, 2, 3, 4, -1, 0}
Please use assertArrayEquals in place of assertEquals so you can test equality in one, single test that will ensure the content is always equal.
assertArrayEquals
assertEquals
Is the null test necessary? What does it even achieve?
By how the kata is defined the number will be out of the range of an int (and even a long) very quickly. The return type should be BigInteger.
int
long
BigInteger
Your tests organization makes no sense. Why is there a non-null test in the testNullability?
testNullability
needs random tests. ;)
Loading collection data...
This comment is hidden because it contains spoiler information about the solution
The Submit tests only test for the element at index 1 when the input array is
null
- it should also check that the element at index 0 is0
in that case.As far as the current test goes I can return
new int[] {1, 1331, 2, 3, 4, -1, 0}
and the test will still consider my result correct.Please use
assertArrayEquals
in place ofassertEquals
so you can test equality in one, single test that will ensure the content is always equal.Is the null test necessary? What does it even achieve?
By how the kata is defined the number will be out of the range of an
int
(and even along
) very quickly. The return type should beBigInteger
.Your tests organization makes no sense. Why is there a non-null test in the
testNullability
?needs random tests. ;)