diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PersonTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PersonTest.java new file mode 100644 index 0000000..4a462db --- /dev/null +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PersonTest.java @@ -0,0 +1,25 @@ +package ch.zhaw.projekt2.turnierverwaltung; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.*; + +public class PersonTest { + private Person person; + + @Test + @DisplayName("Test invalid Parameter") + void invalidParams() { + try { + assertThrows(Person.InvalidPhoneNumberException.class,()->new Person("A","a",".sad")); + person = new Person("A","A",""); + assertEquals("A", person.getFirstName()); + assertEquals("A", person.getName()); + assertEquals("", person.getPhoneNumber()); + } catch (InvalidNameException | Person.InvalidPhoneNumberException e) { + fail(); + } + } + +} diff --git a/app/src/test/java/PlayerTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlayerTest.java similarity index 89% rename from app/src/test/java/PlayerTest.java rename to app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlayerTest.java index 3003af4..9b22d6d 100644 --- a/app/src/test/java/PlayerTest.java +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/PlayerTest.java @@ -1,6 +1,5 @@ -import ch.zhaw.projekt2.turnierverwaltung.InvalidNameException; -import ch.zhaw.projekt2.turnierverwaltung.Person; -import ch.zhaw.projekt2.turnierverwaltung.Player; +package ch.zhaw.projekt2.turnierverwaltung; + import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test;