From 0f7996320e276fe99e165c8ebfe285552552140a Mon Sep 17 00:00:00 2001 From: Sona Markosyan Date: Sun, 30 Jan 2022 13:22:05 +0100 Subject: [PATCH] get person name --- .../hs/fulda/de/ci/exam/project/Person.java | 20 +++++++++++++++++++ .../fulda/de/ci/exam/project/PersonTest.java | 15 ++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/main/java/hs/fulda/de/ci/exam/project/Person.java create mode 100644 src/test/java/hs/fulda/de/ci/exam/project/PersonTest.java diff --git a/src/main/java/hs/fulda/de/ci/exam/project/Person.java b/src/main/java/hs/fulda/de/ci/exam/project/Person.java new file mode 100644 index 0000000..e5e96e8 --- /dev/null +++ b/src/main/java/hs/fulda/de/ci/exam/project/Person.java @@ -0,0 +1,20 @@ +package hs.fulda.de.ci.exam.project; + +import java.util.HashSet; + +public class Person { + private String name; + private Address address; + private String email; + private String phone; + + public Person(String name, Address address, String email, String phone) { + this.name = name; + this.address = address; + this.email = email; + this.phone = phone; + } + public String getName() { + return name; + } +} diff --git a/src/test/java/hs/fulda/de/ci/exam/project/PersonTest.java b/src/test/java/hs/fulda/de/ci/exam/project/PersonTest.java new file mode 100644 index 0000000..65a5c42 --- /dev/null +++ b/src/test/java/hs/fulda/de/ci/exam/project/PersonTest.java @@ -0,0 +1,15 @@ +package hs.fulda.de.ci.exam.project; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.assertThat; + +public class PersonTest { + Address address1 = new Address("Fuldaer str", "Fulda", "Hessen", "36037", "Germany"); + Person person1 = new Person("Max Mustermann", address1, "max.mustermann@gmail.com", "015147890206"); + + @Test + void test_getName() { + assertThat(person1.getName()).describedAs("get person name").isEqualTo("Max Mustermann"); + } +}