- Notifications
You must be signed in to change notification settings - Fork 19.9k
/
Copy pathPartitionProblemTest.java
25 lines (22 loc) · 762 Bytes
/
PartitionProblemTest.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
packagecom.thealgorithms.dynamicprogramming;
importstaticorg.junit.jupiter.api.Assertions.assertFalse;
importstaticorg.junit.jupiter.api.Assertions.assertTrue;
importorg.junit.jupiter.api.Test;
classPartitionProblemTest {
@Test
publicvoidtestIfSumOfTheArrayIsOdd() {
assertFalse(PartitionProblem.partition(newint[] {1, 2, 2}));
}
@Test
publicvoidtestIfSizeOfTheArrayIsOne() {
assertFalse(PartitionProblem.partition(newint[] {2}));
}
@Test
publicvoidtestIfSumOfTheArrayIsEven1() {
assertTrue(PartitionProblem.partition(newint[] {1, 2, 3, 6}));
}
@Test
publicvoidtestIfSumOfTheArrayIsEven2() {
assertFalse(PartitionProblem.partition(newint[] {1, 2, 3, 8}));
}
}