diff --git a/src/test/java/de/hsel/spm/baudas/analysis/ShoppingTimesTest.java b/src/test/java/de/hsel/spm/baudas/analysis/ShoppingTimesTest.java index b5651cc..1087bad 100644 --- a/src/test/java/de/hsel/spm/baudas/analysis/ShoppingTimesTest.java +++ b/src/test/java/de/hsel/spm/baudas/analysis/ShoppingTimesTest.java @@ -12,7 +12,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTimeout; /** - * @author hier Namen eintragen + * @author Karsten Eden * @version 0.1 * @since 0.1 **/ @@ -31,7 +31,27 @@ public class ShoppingTimesTest { assertTimeout(Duration.ofMillis(1700), () -> results.set(overview.getResult())); assertEquals(4, results.get().get(new DayHour("Montag", "10-12 Uhr"))); - //TODO: mehr Tests + assertEquals(9, results.get().get(new DayHour("Samstag", "12-14 Uhr"))); + assertEquals(1, results.get().get(new DayHour("Donnerstag", "14-17 Uhr"))); + assertEquals(3, results.get().get(new DayHour("Mittwoch", ">17 Uhr"))); + assertEquals(6, results.get().get(new DayHour("Dienstag", "<10 Uhr"))); + } + + @Test + public void test1000(){ + URL url = getClass().getClassLoader().getResource("kd1000.csv"); + assert url != null; + ShoppingTimes overview = new ShoppingTimes(new File(url.getFile())); + + AtomicReference> results = new AtomicReference<>(); + + assertTimeout(Duration.ofMillis(3000), () -> results.set(overview.getResult())); + + assertEquals(37, results.get().get(new DayHour("Montag", "10-12 Uhr"))); + assertEquals(87, results.get().get(new DayHour("Samstag", "12-14 Uhr"))); + assertEquals(23, results.get().get(new DayHour("Donnerstag", "14-17 Uhr"))); + assertEquals(18, results.get().get(new DayHour("Mittwoch", ">17 Uhr"))); + assertEquals(18, results.get().get(new DayHour("Dienstag", "<10 Uhr"))); } @Test @@ -42,8 +62,12 @@ public class ShoppingTimesTest { AtomicReference> results = new AtomicReference<>(); - assertTimeout(Duration.ofMillis(550), () -> results.set(overview.getResult())); + assertTimeout(Duration.ofMillis(3000), () -> results.set(overview.getResult())); - //TODO: mehr Tests + assertEquals(303, results.get().get(new DayHour("Montag", "10-12 Uhr"))); + assertEquals(737, results.get().get(new DayHour("Samstag", "12-14 Uhr"))); + assertEquals(192, results.get().get(new DayHour("Donnerstag", "14-17 Uhr"))); + assertEquals(199, results.get().get(new DayHour("Mittwoch", ">17 Uhr"))); + assertEquals(149, results.get().get(new DayHour("Dienstag", "<10 Uhr"))); } } \ No newline at end of file