diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java index a97b044..beb00c7 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/LanguageConfigurator.java @@ -2,7 +2,6 @@ package ch.zhaw.projekt2.turnierverwaltung; import javafx.scene.control.Labeled; import javafx.scene.control.MenuItem; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlaceTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlaceTest.java new file mode 100644 index 0000000..81e6ba6 --- /dev/null +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlaceTest.java @@ -0,0 +1,36 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +public class PlaceTest { + private Place place; + + @Test + @DisplayName("Test Params") + void paramTest() { + Assertions.assertThrows(InvalidNameException.class, () -> new Place("*")); + try { + place = new Place("placeA"); + assertEquals("placeA", place.getName()); + } catch (InvalidNameException e) { + fail(); + } + } + + @Test + @DisplayName("Place Equals Test") + void testEqual() { + try { + place = new Place("placeA"); + assertTrue(place.equals(place)); + assertTrue(place.equals(new Place("placeA"))); + assertFalse(place.equals(new Place("nads"))); + } catch (InvalidNameException e) { + fail(); + } + } +}