Testing #54
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
Loading…
Reference in New Issue