Search in sources :

Example 51 with Date

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

the class ShortDateLabelCreatorTest method givenDateWithYear_whenAskingForNoYear_NoYearIsReturned.

@Test
public void givenDateWithYear_whenAskingForNoYear_NoYearIsReturned() {
    Date date = Date.Companion.on(5, MAY, 1990);
    String dateToString = CREATOR.createLabelWithNoYearFor(date);
    assertThat(dateToString).isEqualTo("05-05");
}
Also used : Date(com.alexstyl.specialdates.date.Date) Test(org.junit.Test)

Example 52 with Date

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

the class OrthodoxEasterCalculatorTest method easternDatesAreCalcualtedProperly.

@Test
public void easternDatesAreCalcualtedProperly() {
    for (int year : EXPECTED_DATES.keySet()) {
        Date expectedDate = EXPECTED_DATES.get(year);
        Date actualDate = calculator.calculateEasterForYear(year);
        assertThat(actualDate).isEqualTo(expectedDate);
        assertThatCalendarsReferToTheSameDate(expectedDate, actualDate);
    }
}
Also used : Date(com.alexstyl.specialdates.date.Date) Test(org.junit.Test)

Example 53 with Date

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

the class CharacterNodeTest method addingADate_isPlacedUnderTheRightNode.

@Test
public void addingADate_isPlacedUnderTheRightNode() {
    Node node = new CharacterNode();
    Date date = Date.Companion.on(1, 2, 1990);
    node.addDate("Alex", date);
    NameCelebrations extracted = node.getDates("Alex");
    assertThat(extracted.getDate(0)).isEqualTo(date);
}
Also used : NameCelebrations(com.alexstyl.specialdates.events.namedays.NameCelebrations) Date(com.alexstyl.specialdates.date.Date) Test(org.junit.Test)

Aggregations

Date (com.alexstyl.specialdates.date.Date)53 Test (org.junit.Test)34 ContactEvent (com.alexstyl.specialdates.date.ContactEvent)12 Contact (com.alexstyl.specialdates.contact.Contact)6 ContactEventsOnADate (com.alexstyl.specialdates.events.peopleevents.ContactEventsOnADate)6 ArrayList (java.util.ArrayList)4 View (android.view.View)3 Intent (android.content.Intent)2 RecyclerView (android.support.v7.widget.RecyclerView)2 TextView (android.widget.TextView)2 NamedayBundle (com.alexstyl.specialdates.events.namedays.NamedayBundle)2 NamedaysList (com.alexstyl.specialdates.events.namedays.NamedaysList)2 NamesInADate (com.alexstyl.specialdates.events.namedays.NamesInADate)2 Calendar (java.util.Calendar)2 DatePickerDialog (android.app.DatePickerDialog)1 PendingIntent (android.app.PendingIntent)1 DialogInterface (android.content.DialogInterface)1 Preference (android.preference.Preference)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RemoteViews (android.widget.RemoteViews)1