- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCoinChangeTest.java
More file actions
Latest commit
24 lines (21 loc) · 788 Bytes
/
Copy pathCoinChangeTest.java
File metadata and controls
24 lines (21 loc) · 788 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
importorg.example.problems.coin_change.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;
publicclassCoinChangeTest {
privatestaticStream<Arguments> provideCases() {
returnStream.of(
Arguments.of(newint[]{1,2,5}, 11, 3),
Arguments.of(newint[]{2}, 3, -1),
Arguments.of(newint[]{1}, 0, 0)
);
}
@ParameterizedTest
@MethodSource("provideCases")
publicvoidtest(int[] coins, intamount, intexpected) {
Solutions = newSolution();
Assertions.assertSame(expected, s.coinChange(coins, amount));
}
}