- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathValidParenthesesTest.java
More file actions
Latest commit
27 lines (23 loc) · 847 Bytes
/
Copy pathValidParenthesesTest.java
File metadata and controls
27 lines (23 loc) · 847 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
importorg.example.problems.valid_parentheses.Solution;
importorg.junit.jupiter.api.Assertions;
importorg.junit.jupiter.params.ParameterizedTest;
importorg.junit.jupiter.params.provider.Arguments;
importorg.junit.jupiter.params.provider.MethodSource;
importjava.util.stream.Stream;
publicclassValidParenthesesTest {
privatestaticStream<Arguments> provideCases() {
returnStream.of(
Arguments.of("()", true),
Arguments.of("()[]{}", true),
Arguments.of("(]", false),
Arguments.of("([)]", false),
Arguments.of("([]){}", true)
);
}
@ParameterizedTest
@MethodSource("provideCases")
publicvoidtest(Strings, booleanexpected) {
Solutionsolution = newSolution();
Assertions.assertSame(expected, solution.isValid(s));
}
}