Search in sources :

Example 21 with ContactEvent

use of com.alexstyl.specialdates.date.ContactEvent in project Memento-Calendar by alexstyl.

the class ContactActionTest method testContactsAreCorrectlyReturned.

@Test
public void testContactsAreCorrectlyReturned() {
    Date date = Date.Companion.on(1, JANUARY, 2016);
    ArrayList<ContactEvent> contactEvent = new ArrayList<>();
    contactEvent.add(EVENT_ONE);
    contactEvent.add(EVENT_TWO);
    ContactEventsOnADate events = ContactEventsOnADate.Companion.createFrom(date, contactEvent);
    List<Contact> contacts = events.getContacts();
    assertThat(contacts).contains(CONTACT_ONE);
    assertThat(contacts).contains(CONTACT_TWO);
}
Also used : ContactEvent(com.alexstyl.specialdates.date.ContactEvent) ArrayList(java.util.ArrayList) ContactEventsOnADate(com.alexstyl.specialdates.events.peopleevents.ContactEventsOnADate) ContactEventsOnADate(com.alexstyl.specialdates.events.peopleevents.ContactEventsOnADate) Date(com.alexstyl.specialdates.date.Date) Contact(com.alexstyl.specialdates.contact.Contact) Test(org.junit.Test)

Example 22 with ContactEvent

use of com.alexstyl.specialdates.date.ContactEvent in project Memento-Calendar by alexstyl.

the class ContactActionTest method testContactCorrectContactIsReturned.

@Test
public void testContactCorrectContactIsReturned() {
    Date date = Date.Companion.on(1, JANUARY, 2016);
    ArrayList<ContactEvent> contactEvent = new ArrayList<>();
    contactEvent.add(EVENT_ONE);
    ContactEventsOnADate events = ContactEventsOnADate.Companion.createFrom(date, contactEvent);
    List<Contact> contacts = events.getContacts();
    assertThat(contacts.get(0)).isEqualTo(CONTACT_ONE);
}
Also used : ContactEvent(com.alexstyl.specialdates.date.ContactEvent) ArrayList(java.util.ArrayList) ContactEventsOnADate(com.alexstyl.specialdates.events.peopleevents.ContactEventsOnADate) ContactEventsOnADate(com.alexstyl.specialdates.events.peopleevents.ContactEventsOnADate) Date(com.alexstyl.specialdates.date.Date) Contact(com.alexstyl.specialdates.contact.Contact) Test(org.junit.Test)

Aggregations

ContactEvent (com.alexstyl.specialdates.date.ContactEvent)22 Test (org.junit.Test)13 Date (com.alexstyl.specialdates.date.Date)12 Contact (com.alexstyl.specialdates.contact.Contact)9 ArrayList (java.util.ArrayList)8 ContactEventsOnADate (com.alexstyl.specialdates.events.peopleevents.ContactEventsOnADate)3 URL (java.net.URL)3 Notification (android.app.Notification)1 PendingIntent (android.app.PendingIntent)1 ContentValues (android.content.ContentValues)1 Intent (android.content.Intent)1 Bitmap (android.graphics.Bitmap)1 Paint (android.graphics.Paint)1 NotificationCompat (android.support.v4.app.NotificationCompat)1 Spannable (android.text.Spannable)1 SpannableString (android.text.SpannableString)1 StyleSpan (android.text.style.StyleSpan)1 DisplayName (com.alexstyl.specialdates.contact.DisplayName)1 DateParseException (com.alexstyl.specialdates.date.DateParseException)1 TimePeriod (com.alexstyl.specialdates.date.TimePeriod)1