Skip to content

Commit bce1973

Browse files
update 351 test
1 parent 7edc4bd commit bce1973

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.fishercoder.firstthousand;
2+
3+
import com.fishercoder.solutions.firstthousand._985;
4+
import org.junit.jupiter.api.BeforeEach;
5+
import org.junit.jupiter.api.Test;
6+
7+
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
8+
9+
public class _351Test {
10+
private static _985.Solution1 solution1;
11+
private static int[] expected;
12+
private static int[] actual;
13+
private static int[] A;
14+
private static int[][] queries;
15+
16+
@BeforeEach
17+
public void setup() {
18+
solution1 = new _985.Solution1();
19+
}
20+
21+
@Test
22+
public void test1() {
23+
A = new int[]{1, 2, 3, 4};
24+
queries = new int[][]{{1, 0}, {-3, 1}, {-4, 0}, {2, 3}};
25+
expected = new int[]{8, 6, 2, 4};
26+
actual = solution1.sumEvenAfterQueries(A, queries);
27+
assertArrayEquals(expected, actual);
28+
}
29+
}

0 commit comments

Comments
 (0)