mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-31 16:56:40 +08:00
26 lines
762 B
Java
26 lines
762 B
Java
package com.thealgorithms.dynamicprogramming;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
class PartitionProblemTest {
|
|
@Test
|
|
public void testIfSumOfTheArrayIsOdd() {
|
|
assertFalse(PartitionProblem.partition(new int[] {1, 2, 2}));
|
|
}
|
|
@Test
|
|
public void testIfSizeOfTheArrayIsOne() {
|
|
assertFalse(PartitionProblem.partition(new int[] {2}));
|
|
}
|
|
@Test
|
|
public void testIfSumOfTheArrayIsEven1() {
|
|
assertTrue(PartitionProblem.partition(new int[] {1, 2, 3, 6}));
|
|
}
|
|
@Test
|
|
public void testIfSumOfTheArrayIsEven2() {
|
|
assertFalse(PartitionProblem.partition(new int[] {1, 2, 3, 8}));
|
|
}
|
|
}
|