Files
Java/src/test/java/com/thealgorithms/dynamicprogramming/PartitionProblemTest.java
2024-05-05 20:48:56 +02:00

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}));
}
}