From 0f7996320e276fe99e165c8ebfe285552552140a Mon Sep 17 00:00:00 2001 From: Sona Markosyan Date: Sun, 30 Jan 2022 13:22:05 +0100 Subject: [PATCH 1/3] 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"); + } +} From e4b3661b84c44e66b91d54420e2f351429e80e60 Mon Sep 17 00:00:00 2001 From: Sona Markosyan Date: Sun, 30 Jan 2022 13:59:16 +0100 Subject: [PATCH 2/3] get email of a person --- .../hs/fulda/de/ci/exam/project/Person.class | Bin 0 -> 925 bytes .../hs/fulda/de/ci/exam/project/PersonTest.class | Bin 0 -> 1996 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 target/classes/hs/fulda/de/ci/exam/project/Person.class create mode 100644 target/test-classes/hs/fulda/de/ci/exam/project/PersonTest.class diff --git a/target/classes/hs/fulda/de/ci/exam/project/Person.class b/target/classes/hs/fulda/de/ci/exam/project/Person.class new file mode 100644 index 0000000000000000000000000000000000000000..4407f72a218ce4883db3319306113f903f4fc59c GIT binary patch literal 925 zcma)4UrQT75dZDvk~8sY+EiO(Yg?_Q$=P;a1RpAbh&}}?Sn?=ra@%C(awnHd@zIZ@ zU?}vVAD|zqbY?H0m>_bnGrK##KQp&~|NZ_0U>h41cz9h#39G!k;pHta?>ww|SQl_( zHP8aJ)|vXLWTfJrJjqfM_r3~vDhyLS9147B^@sAuC<>Jfwd@+HFVsMur^%V_W^ykt zBScXTl!+*w_mh}tOFJeu*{;B8V_M)*oHJlkPMdA&V?PN=u-Y=QJ{k==I{mIXk?kz$ zs;I3}!~4mhoAnK~weg^ZW1S9@nCH;b*^wR7Vxu{2NT5OmlOYIvq?*S~YmQ(C`M@eC z$tdmWL&KKmbLB7GsE-A__c4dEj|%2}_?$gKSz!Gkm7GH0>Fu<>b@*=y6dKJo*60y< z^hR7bOir1@{5Fz=jih2L1bL`}xM+7tbw!FR!7qqla||c=G)5u#Jcb+8-7$*S7W<5A zNCU*_vT5?XK;Ls>suNR2t@wI}2it8%AQE@|qhMO{aOa3cr_!hTSe5YVd!vxk9+>y__a`Ah)_=Adj z8cxfVl6-E+l}#1*6+B>2d9CIN-(O;wFYWo}^Jb&Q&6+T)mMIRoZ60{;zNiLfG2B;R zP!5FWyAEZX@0;!NFk9@)bR0L}f#o`cI$d(T zy1Cz^@@PD;0^ynbz%nDGR2wN0&oI)Ctl8XZFlbwD)2oVgOV*zX70cwsef~SwaUSyw z=RUz!hT(PTyztU~;4z$N&B(gDbT-1F!179NIZx)_5uVMRKP2{#I?|Y9INOgPtchWC zgCC|hnm$RSd_tVG`Qf773EZknMT=F}CI@p%SC_8judU`T=T;=sLmg*vPRAC?3VzbD zjUAFp7N^6zkak*Dk4e>LgFAKeens9I9Y152AuCf%!z=G` zGUR5Dg0rng3U__vh^a$|Yr?O3Rz=i`)P$=&@E*tN3=g#sFFgt|BrSjKwB z*=f{^B(>iOw@qZo$LTvm7nQdX}SM&rHJ0u$s$!th+>Ln(PsgUH0*ElVe u9AWwc8Uts@vM$YRPa3mB^PZL&spU*ei{4AiDbg|-Bk84uAxC-=Sb7K4*#Pwb literal 0 HcmV?d00001 From 205cfbf9b8efac875286643e66ed167922632da6 Mon Sep 17 00:00:00 2001 From: Sona Markosyan Date: Sun, 30 Jan 2022 14:05:47 +0100 Subject: [PATCH 3/3] get phone number of a person --- .../java/hs/fulda/de/ci/exam/project/Person.java | 9 +++++++++ .../hs/fulda/de/ci/exam/project/PersonTest.java | 15 +++++++++++++++ 2 files changed, 24 insertions(+) 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 index e5e96e8..34674cd 100644 --- a/src/main/java/hs/fulda/de/ci/exam/project/Person.java +++ b/src/main/java/hs/fulda/de/ci/exam/project/Person.java @@ -17,4 +17,13 @@ public class Person { public String getName() { return name; } + public Address getAddress() { + return address; + } + public String getEmail() { + return email; + } + public String getPhone() { + return phone; + } } 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 index 65a5c42..30db8bf 100644 --- a/src/test/java/hs/fulda/de/ci/exam/project/PersonTest.java +++ b/src/test/java/hs/fulda/de/ci/exam/project/PersonTest.java @@ -12,4 +12,19 @@ public class PersonTest { void test_getName() { assertThat(person1.getName()).describedAs("get person name").isEqualTo("Max Mustermann"); } + + @Test + void test_getAddress() { + assertThat(person1.getAddress()).describedAs("get address of person").isEqualTo(address1); + } + + @Test + void test_getEmail() { + assertThat(person1.getEmail()).describedAs("get person email").isEqualTo("max.mustermann@gmail.com"); + } + @Test + void test_getPhone() { + assertThat(person1.getPhone()).describedAs("get person phone").isEqualTo("015147890206"); + } + }