- Notifications
You must be signed in to change notification settings - Fork 19.9k
/
Copy pathBoardPathTest.java
33 lines (26 loc) · 1.1 KB
/
BoardPathTest.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
packagecom.thealgorithms.dynamicprogramming;
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
importjava.util.stream.Stream;
importorg.junit.jupiter.params.ParameterizedTest;
importorg.junit.jupiter.params.provider.Arguments;
importorg.junit.jupiter.params.provider.MethodSource;
publicclassBoardPathTest {
@ParameterizedTest
@MethodSource("provideTestCases")
voidtestBpR(intstart, intend, intexpected) {
assertEquals(expected, BoardPath.bpR(start, end));
}
@ParameterizedTest
@MethodSource("provideTestCases")
voidtestBpRS(intstart, intend, intexpected) {
assertEquals(expected, BoardPath.bpRS(start, end, newint[end + 1]));
}
@ParameterizedTest
@MethodSource("provideTestCases")
voidtestBpIS(intstart, intend, intexpected) {
assertEquals(expected, BoardPath.bpIS(start, end, newint[end + 1]));
}
privatestaticStream<Arguments> provideTestCases() {
returnStream.of(Arguments.of(0, 10, 492), Arguments.of(0, 5, 16), Arguments.of(0, 6, 32), Arguments.of(0, 3, 4), Arguments.of(0, 1, 1));
}
}