refactor: move test files

This commit is contained in:
2026-04-16 18:33:38 +03:30
parent ce2268ac06
commit 70fda9d1e6
7 changed files with 14 additions and 0 deletions
@@ -0,0 +1,67 @@
package MainTests;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
public class TestPartitions {
static Exercises ex;
@BeforeAll
static void setUp() {
ex = new Exercises();
}
@Test
void testPartition0() {
int[][] expected = {
{1}
};
assertArrayEquals(expected, ex.intPartitions(1));
}
@Test
void testPartition1() {
int[][] expected = {
{4},
{3, 1},
{2, 2},
{2, 1, 1},
{1, 1, 1, 1}
};
assertArrayEquals(expected, ex.intPartitions(4));
}
@Test
void testPartition2() {
int[][] expected = {
{5},
{4, 1},
{3, 2},
{3, 1, 1},
{2, 2, 1},
{2, 1, 1, 1},
{1, 1, 1, 1, 1}
};
assertArrayEquals(expected, ex.intPartitions(5));
}
@Test
void testPartition3() {
int[][] expected = {
{6},
{5, 1},
{4, 2},
{4, 1, 1},
{3, 3},
{3, 2, 1},
{3, 1, 1, 1},
{2, 2, 2},
{2, 2, 1, 1},
{2, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1}
};
assertArrayEquals(expected, ex.intPartitions(6));
}
}