|
1 | 1 | package com.fishercoder;
|
2 | 2 |
|
3 | 3 | import com.fishercoder.solutions._740;
|
4 |
| -import org.junit.BeforeClass; |
5 |
| -import org.junit.Test; |
| 4 | +import org.junit.jupiter.api.BeforeEach; |
| 5 | +import org.junit.jupiter.api.Test; |
6 | 6 |
|
7 |
| -import static org.junit.Assert.assertEquals; |
| 7 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
8 | 8 |
|
9 | 9 | public class _740Test {
|
10 |
| - private static _740.Solution1 solution1; |
11 |
| - private static int[] nums; |
| 10 | + private static _740.Solution1 solution1; |
| 11 | + private static _740.Solution2 solution2; |
| 12 | + private static _740.Solution3 solution3; |
| 13 | + private static int[] nums; |
12 | 14 |
|
13 |
| - @BeforeClass |
14 |
| - public static void setup() { |
15 |
| - solution1 = new _740.Solution1(); |
16 |
| - } |
| 15 | + @BeforeEach |
| 16 | + public void setup() { |
| 17 | + solution1 = new _740.Solution1(); |
| 18 | + solution2 = new _740.Solution2(); |
| 19 | + solution3 = new _740.Solution3(); |
| 20 | + } |
17 | 21 |
|
18 |
| - @Test |
19 |
| - public void test1() { |
20 |
| - nums = new int[] {3, 4, 2}; |
21 |
| - assertEquals(6, solution1.deleteAndEarn(nums)); |
22 |
| - } |
| 22 | + @Test |
| 23 | + public void test1() { |
| 24 | + nums = new int[]{3, 4, 2}; |
| 25 | + assertEquals(6, solution1.deleteAndEarn(nums)); |
| 26 | + assertEquals(6, solution2.deleteAndEarn(nums)); |
| 27 | + assertEquals(6, solution3.deleteAndEarn(nums)); |
| 28 | + } |
23 | 29 |
|
24 |
| - @Test |
25 |
| - public void test2() { |
26 |
| - nums = new int[] {2, 2, 3, 3, 3, 4}; |
27 |
| - assertEquals(9, solution1.deleteAndEarn(nums)); |
28 |
| - } |
| 30 | + @Test |
| 31 | + public void test2() { |
| 32 | + nums = new int[]{2, 2, 3, 3, 3, 4}; |
| 33 | + assertEquals(9, solution1.deleteAndEarn(nums)); |
| 34 | + assertEquals(9, solution2.deleteAndEarn(nums)); |
| 35 | + assertEquals(9, solution3.deleteAndEarn(nums)); |
| 36 | + } |
29 | 37 | }
|
0 commit comments