-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest0283.java
More file actions
34 lines (27 loc) · 812 Bytes
/
Test0283.java
File metadata and controls
34 lines (27 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package leetcode;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
/**
* @author xiangdotzhaoAtwoqutechcommacom
* @date 2019/12/14
*/
class Test0283 {
private final Solution0283 solution = new Solution0283();
@Test
@DisplayName("Move Zeroes")
void moveZeroes() {
int[] origin = {0, 1, 0, 3, 12};
int[] expected = {1, 3, 12, 0, 0};
solution.moveZeroes(origin);
assertArrayEquals(expected, origin);
}
@Test
@DisplayName("Move Zeroes")
void moveZeroesSwapBased() {
int[] origin = {0, 1, 0, 3, 12};
int[] expected = {1, 3, 12, 0, 0};
solution.moveZeroesSwapBased(origin);
assertArrayEquals(expected, origin);
}
}