We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6366ce commit 667012bCopy full SHA for 667012b
src/test/java/com/fishercoder/_31Test.java
@@ -1,10 +1,11 @@
1
package com.fishercoder;
2
3
-import com.fishercoder.common.utils.CommonUtils;
4
import com.fishercoder.solutions._31;
5
import org.junit.BeforeClass;
6
import org.junit.Test;
7
+import static org.junit.Assert.assertArrayEquals;
8
+
9
public class _31Test {
10
private static _31.Solution1 solution1;
11
private static int[] nums;
@@ -18,6 +19,20 @@ public static void setup() {
18
19
public void test1() {
20
nums = new int[]{1, 2, 3};
21
solution1.nextPermutation(nums);
- CommonUtils.printArray(nums);
22
+ assertArrayEquals(new int[]{1, 3, 2}, nums);
23
+ }
24
25
+ @Test
26
+ public void test2() {
27
+ nums = new int[]{1, 2, 4, 6, 3};
28
+ solution1.nextPermutation(nums);
29
+ assertArrayEquals(new int[]{1, 2, 6, 3, 4}, nums);
30
31
32
33
+ public void test3() {
34
+ nums = new int[]{1, 2, 4, 6, 3, 2, 1};
35
36
+ assertArrayEquals(new int[]{1, 2, 6, 1, 2, 3, 4}, nums);
37
}
38
0 commit comments