use of com.alexstyl.specialdates.date.ContactEvent in project Memento-Calendar by alexstyl.
the class EventLabelCreatorTest method birthdayWithoutYearIsCalculatedCorrectly.
@Test
public void birthdayWithoutYearIsCalculatedCorrectly() {
Date date = Date.Companion.on(12, DECEMBER);
ContactEvent event = contactEventOn(date, BIRTHDAY);
String label = creator.createFor(event);
assertThat(label).isEqualTo("Birthday on December 12");
}
use of com.alexstyl.specialdates.date.ContactEvent in project Memento-Calendar by alexstyl.
the class EventLabelCreatorTest method namedayIsCalculatedCorrectly.
@Test
public void namedayIsCalculatedCorrectly() {
Date date = Date.Companion.on(12, DECEMBER);
ContactEvent event = contactEventOn(date, NAMEDAY);
String label = creator.createFor(event);
assertThat(label).isEqualTo("Nameday on December 12");
}
use of com.alexstyl.specialdates.date.ContactEvent in project Memento-Calendar by alexstyl.
the class FacebookContactFactoryTest method name.
@Test
public void name() throws DateParseException, InvalidFacebookContactException {
HashMap<String, String> map = new HashMap<>();
map.put("UID", "b123124@facebook.com");
map.put("DTSTART", "20180612");
map.put("SUMMARY", "Thanasis Thomopoulos's birthday");
ContactEvent contactEvent = factory.createContactFrom(map);
Contact contact = contactEvent.getContact();
assertThat(contact.getDisplayName()).isEqualTo(DisplayName.Companion.from("Thanasis Thomopoulos"));
assertThat(contact.getContactID()).isEqualTo(123124);
}
use of com.alexstyl.specialdates.date.ContactEvent in project Memento-Calendar by alexstyl.
the class FacebookBirthdaysProviderTest method parseMockCalendar.
@Test
public void parseMockCalendar() throws CalendarFetcherException, MalformedURLException {
FacebookContactFactory factory = new FacebookContactFactory(parser);
FacebookBirthdaysProvider fetcher = new FacebookBirthdaysProvider(new FacebookCalendarLoader(), new ContactEventSerialiser(factory, tracker));
URL url = new URL(CALENDAR_URL);
List<ContactEvent> contacts = fetcher.fetchCalendarFrom(url);
assertThat(contacts).isNotEmpty();
}
use of com.alexstyl.specialdates.date.ContactEvent in project Memento-Calendar by alexstyl.
the class EventLabelCreatorTest method anniversaryIsCalculatedCorrectly.
@Test
public void anniversaryIsCalculatedCorrectly() {
Date date = Date.Companion.on(12, DECEMBER);
ContactEvent event = contactEventOn(date, ANNIVERSARY);
String label = creator.createFor(event);
assertThat(label).isEqualTo("Anniversary on December 12");
}
Aggregations