From 03d916fa3167bf95d39841d6e971f41da70ff596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 1 Jul 2024 20:37:02 +0200 Subject: [PATCH] feat: first two tests --- .gitignore | 29 ++++ .idea/.gitignore | 3 + .idea/inspectionProfiles/Project_Default.xml | 7 + .idea/misc.xml | 6 + .idea/modules.xml | 8 ++ .idea/uiDesigner.xml | 124 ++++++++++++++++++ .idea/vcs.xml | 6 + src/main/java/Main.java | 15 +++ .../java/WardrobeBuilder/WardrobeBuilder.java | 11 ++ src/test/java/MainTest.java | 23 ++++ wardrobe.iml | 28 ++++ 11 files changed, 260 insertions(+) create mode 100644 .gitignore create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/uiDesigner.xml create mode 100644 .idea/vcs.xml create mode 100644 src/main/java/Main.java create mode 100644 src/main/java/WardrobeBuilder/WardrobeBuilder.java create mode 100644 src/test/java/MainTest.java create mode 100644 wardrobe.iml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f68d109 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +### IntelliJ IDEA ### +out/ +!**/src/main/**/out/ +!**/src/test/**/out/ + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache +bin/ +!**/src/main/**/bin/ +!**/src/test/**/bin/ + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..273180d --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..1945ce5 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5787d5b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/main/java/Main.java b/src/main/java/Main.java new file mode 100644 index 0000000..66390e2 --- /dev/null +++ b/src/main/java/Main.java @@ -0,0 +1,15 @@ +//TIP To Run code, press or +// click the icon in the gutter. +public class Main { + public static void main(String[] args) { + //TIP Press with your caret at the highlighted text + // to see how IntelliJ IDEA suggests fixing it. + System.out.print("Hello and welcome!"); + + for (int i = 1; i <= 5; i++) { + //TIP Press to start debugging your code. We have set one breakpoint + // for you, but you can always add more by pressing . + System.out.println("i = " + i); + } + } +} diff --git a/src/main/java/WardrobeBuilder/WardrobeBuilder.java b/src/main/java/WardrobeBuilder/WardrobeBuilder.java new file mode 100644 index 0000000..ed45f73 --- /dev/null +++ b/src/main/java/WardrobeBuilder/WardrobeBuilder.java @@ -0,0 +1,11 @@ +package WardrobeBuilder; + +import java.util.ArrayList; +import java.util.List; + +public class WardrobeBuilder { + public static List> allCombinations(List elememts, int target) { + List wardrobe = List.of(50); + return List.of(wardrobe); + } +} diff --git a/src/test/java/MainTest.java b/src/test/java/MainTest.java new file mode 100644 index 0000000..3432774 --- /dev/null +++ b/src/test/java/MainTest.java @@ -0,0 +1,23 @@ +import WardrobeBuilder.WardrobeBuilder; + +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class MainTest { + + @org.junit.jupiter.api.Test + void onlyOneWardrobeFromOneElement() { + List elememts = List.of(50); + List> wardrobes = WardrobeBuilder.allCombinations(elememts, 50); + assertEquals(1, wardrobes.size()); + } + + @org.junit.jupiter.api.Test + void sameHeightFromOneElement() { + List elememts = List.of(50); + List> wardrobes = WardrobeBuilder.allCombinations(elememts, 50); + List wardrobe = wardrobes.getFirst(); + assertEquals(wardrobe, elememts); + } +} diff --git a/wardrobe.iml b/wardrobe.iml new file mode 100644 index 0000000..0780e9e --- /dev/null +++ b/wardrobe.iml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file