Testing #54

Merged
schrom01 merged 12 commits from testing into main 2022-05-13 23:03:37 +02:00
2 changed files with 27 additions and 3 deletions
Showing only changes of commit fd06e24e21 - Show all commits

View File

@ -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();
}
}
}

View File

@ -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;