use of com.alexstyl.specialdates.date.Date in project Memento-Calendar by alexstyl.
the class EventLabelCreatorTest method otherIsCalculatedCorrectly.
@Test
public void otherIsCalculatedCorrectly() {
Date date = Date.Companion.on(12, DECEMBER);
ContactEvent event = contactEventOn(date, OTHER);
String label = creator.createFor(event);
assertThat(label).isEqualTo("Other on December 12");
}
use of com.alexstyl.specialdates.date.Date in project Memento-Calendar by alexstyl.
the class ContactActionTest method testReturnedContactsSizeIsCorrect.
@Test
public void testReturnedContactsSizeIsCorrect() {
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.size()).isEqualTo(2);
}
use of com.alexstyl.specialdates.date.Date in project Memento-Calendar by alexstyl.
the class ShortDateLabelCreatorTest method givenDateWithYear_whenAskingYear_thenYearIsReturned.
@Test
public void givenDateWithYear_whenAskingYear_thenYearIsReturned() {
Date date = Date.Companion.on(5, MAY, 1995);
String dateToString = CREATOR.createLabelWithYearPreferredFor(date);
assertThat(dateToString).isEqualTo("1995-05-05");
}
use of com.alexstyl.specialdates.date.Date in project Memento-Calendar by alexstyl.
the class ShortDateLabelCreatorTest method givenDateWithNoYear_whenAskingForYear_NoYearIsReturned.
@Test
public void givenDateWithNoYear_whenAskingForYear_NoYearIsReturned() {
Date date = Date.Companion.on(5, MAY);
String dateToString = CREATOR.createLabelWithYearPreferredFor(date);
assertThat(dateToString).isEqualTo("--05-05");
}
use of com.alexstyl.specialdates.date.Date in project Memento-Calendar by alexstyl.
the class DailyReminderIntentService method getDayDateToDisplay.
private Date getDayDateToDisplay() {
if (BuildConfig.DEBUG) {
DailyReminderDebugPreferences preferences = DailyReminderDebugPreferences.newInstance(this);
if (preferences.isFakeDateEnabled()) {
Date selectedDate = preferences.getSelectedDate();
Log.d("Using DEBUG date to display: " + selectedDate);
return selectedDate;
}
}
return Date.Companion.today();
}
Aggregations