package runtime;
public class Solution {
public static long sum(int... nums) {
long sum = 0;
for (long l : nums) {
sum += l;
}
return sum;
}
}
package tests;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import org.junit.runners.JUnit4;
import cheatengine.CheckClasses;
import java.util.Set;
import runtime.Solution;
// TODO: Replace examples and use TDD by writing your own tests
public class SolutionTest {
private static final Set<String> VIOLATIONS = CheckClasses.checkPackage(Solution.class);
@Test
public void noCheat() {
assertEquals(Set.of(), VIOLATIONS);
}
@Test
public void testSomething() {
assertEquals(10, Solution.sum(1,2,3,4));
}
}