Search in sources :

Example 6 with ContactEventsOnADate

use of com.alexstyl.specialdates.events.peopleevents.ContactEventsOnADate 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)

Example 7 with ContactEventsOnADate

use of com.alexstyl.specialdates.events.peopleevents.ContactEventsOnADate in project Memento-Calendar by alexstyl.

the class ContactActionTest method testTheSameDateIsReturned.

@Test
public void testTheSameDateIsReturned() throws Exception {
    Date expectedDate = Date.Companion.on(1, JANUARY, 1990);
    ContactEventsOnADate events = ContactEventsOnADate.Companion.createFrom(expectedDate, ANY_CONTACTS);
    Date actualDate = events.getDate();
    assertThat(actualDate).isEqualTo(expectedDate);
}
Also used : ContactEventsOnADate(com.alexstyl.specialdates.events.peopleevents.ContactEventsOnADate) ContactEventsOnADate(com.alexstyl.specialdates.events.peopleevents.ContactEventsOnADate) Date(com.alexstyl.specialdates.date.Date) Test(org.junit.Test)

Aggregations

ContactEventsOnADate (com.alexstyl.specialdates.events.peopleevents.ContactEventsOnADate)7 Date (com.alexstyl.specialdates.date.Date)6 Test (org.junit.Test)4 Contact (com.alexstyl.specialdates.contact.Contact)3 ContactEvent (com.alexstyl.specialdates.date.ContactEvent)3 ArrayList (java.util.ArrayList)3 PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1 RemoteViews (android.widget.RemoteViews)1 Optional (com.alexstyl.specialdates.Optional)1 GoogleApiClient (com.google.android.gms.common.api.GoogleApiClient)1 PutDataRequest (com.google.android.gms.wearable.PutDataRequest)1