-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathGenerateParenthesesTest.java
34 lines (27 loc) · 1.02 KB
/
GenerateParenthesesTest.java
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 by.andd3dfx.common;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class GenerateParenthesesTest {
@Test
public void generate1() {
assertThat(GenerateParentheses.generate(1))
.containsExactlyInAnyOrder("()");
}
@Test
public void generate2() {
assertThat(GenerateParentheses.generate(2))
.containsExactlyInAnyOrder("()()", "(())");
}
@Test
public void generate3() {
assertThat(GenerateParentheses.generate(3))
.containsExactlyInAnyOrder("((()))", "(()())", "(())()", "()(())", "()()()");
}
@Test
public void generate4() {
assertThat(GenerateParentheses.generate(4))
.containsExactlyInAnyOrder("(((())))", "((()()))", "((())())", "((()))()", "(()(()))",
"(()()())", "(()())()", "(())(())", "(())()()", "()((()))", "()(()())", "()(())()",
"()()(())", "()()()()");
}
}