Skip to content

Commit

Permalink
update 351 test
Browse files Browse the repository at this point in the history
  • Loading branch information
fishercoder1534 committed Aug 8, 2024
1 parent 8be01e9 commit f45bfec
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/test/java/com/fishercoder/firstthousand/_351Test.java
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
package com.fishercoder.firstthousand;

import com.fishercoder.solutions.firstthousand._985;
import com.fishercoder.solutions.firstthousand._351;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class _351Test {
private static _985.Solution1 solution1;
private static int[] expected;
private static int[] actual;
private static int[] A;
private static int[][] queries;
private static _351.Solution1 solution1;

@BeforeEach
public void setup() {
solution1 = new _985.Solution1();
solution1 = new _351.Solution1();
}

@Test
public void test1() {
A = new int[]{1, 2, 3, 4};
queries = new int[][]{{1, 0}, {-3, 1}, {-4, 0}, {2, 3}};
expected = new int[]{8, 6, 2, 4};
actual = solution1.sumEvenAfterQueries(A, queries);
assertArrayEquals(expected, actual);
assertEquals(9, solution1.numberOfPatterns(1, 1));
}
}

0 comments on commit f45bfec

Please sign in to comment.