package com.marekdudek.basic;

import org.junit.Test;

import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertThat;

public class BasicTest {

    @Test
    public void person() {

        final Person0 person =
                new Person0(
                        new TelephoneNumber0("+48507238827"),
                        new Address0("ul. Polna 7/12, Wroclaw, Poland"),
                        new EmailAddress0("jan.kowalski@gmail.com")
                );

        assertThat(person.getAddress(), is(notNullValue()));
    }

    @Test
    public void company() {

        final Company0 company =
                new Company0(
                        new TelephoneNumber0("+480713517503"),
                        new Address0("pl. Grunwaldzki 8, Wroclaw, Poland"),
                        new EmailAddress0("biuro@spolkazoo.pl")
                );

        assertThat(company.getAddress(), is(notNullValue()));
    }
}

@@ -59,40 +59,83 @@
 ort 
-static org.hamcrest.Matchers.is;
+java.util.ArrayList;%0Aimport java.util.Arrays;%0Aimport java.util.Collection;%0A
 %0Aimp
@@ -167,27 +167,22 @@
 atchers.
-notNullValu
+hasSiz
 e;%0Aimpor
@@ -274,20 +274,34 @@
  void pe
-rson
+ople_and_companies
 () %7B%0A%0A  
@@ -316,212 +316,580 @@
 nal 
-Person0 person =%0A             
+Company0 townTaxi   = new Company0(new TelephoneNumber0(%22+34 (045) 432 1432%22), null, null);%0A        final Company0 shoemaker
   
+=
  new 
-Person0(%0A                        new TelephoneNumber0(%22+48507238827%22),%0A                    
+Company0(null, new Address0(%22High Street 12B%22), null);%0A        final Company0 accountant = new Company0(null, null, new EmailAddress0(%22john.smith@cpa.org%22));%0A%0A        final Person0 wife     = new Person0(new TelephoneNumber0(%22214 321 124%22), null, null);%0A        final Person0 mother
    
+=
  new 
-Address0(%22ul. Polna 7/12, Wroclaw, Poland%22),%0A                       
+Person0(new TelephoneNumber0(%22564 423 754%22), null, null);%0A        final Person0 son      = new Person0(new TelephoneNumber0(%22+64 564 423 754%22), null,
  new
@@ -910,18 +910,10 @@
 (%22ja
-n.kowalski
+ck
 @gma
@@ -924,37 +924,19 @@
 om%22)
-%0A                
 );%0A
-%0A
         
 asse
@@ -935,451 +935,834 @@
     
-assertThat(person.getAddress(), is(notNullValue()
+final Person0 daughter = new Person0(new TelephoneNumber0(%22+64 564 423 754%22), null, new EmailAddress0(%22kate@gmail.com%22
 ));%0A
+%0A
     
-%7D%0A%0A    @Test%0A    public void company() %7B%0A%0A        final Company0 company =%0A        
+    final Person0 aquaintance = new Person0(null, null, new EmailAddress0(%22tom.tackson@come-company.com%22));%0A        final Person0 doctor
       
- 
+=
  new 
-Company0(%0A                        new TelephoneNumber0(%22+480713517503%22),%0A                        new Address0(%22pl. Grunwaldzki 8, Wroclaw, Poland%22),%0A                        new EmailAddress0(%22biuro@spolkazoo.pl%22)%0A                );%0A%0A        assertThat(company.getAddress(), is(notNullValue()
+Person0(null, new Address0(%22North St. 1D%22), null);%0A        final Person0 barber      = new Person0(new TelephoneNumber0(%22643 124 4311%22), null, null);%0A%0A        final Collection%3CCompany0%3E companies = Arrays.asList(townTaxi, shoemaker, accountant);%0A        final Collection%3CPerson0%3E  people    = Arrays.asList(wife, mother, son, daughter, aquaintance, doctor, barber);%0A%0A        final Collection%3CObject%3E addressBook = new ArrayList%3C%3E();%0A        addressBook.addAll(people);%0A        addressBook.addAll(companies);%0A%0A        assertThat(addressBook, hasSize(10
 ));%0A

test for people and companies