use of org.fossasia.openevent.app.data.models.dto.ObservableString in project open-event-orga-app by fossasia.
the class TicketCreatePresenterTest method setupMockEvent.
private void setupMockEvent() {
when(event.getTimezone()).thenReturn("UTC");
when(event.getEndsAt()).thenReturn(new ObservableString("2018-12-14T23:59:59.123456+00:00"));
}
use of org.fossasia.openevent.app.data.models.dto.ObservableString in project open-event-orga-app by fossasia.
the class DateServiceTest method testClashPast.
@Test
public void testClashPast() {
Event pastLatest = new Event();
String min = DateUtils.formatDateToIso(LocalDateTime.MIN);
String minPlus5 = DateUtils.formatDateToIso(LocalDateTime.MIN.plusDays(5));
pastLatest.setStartsAt(new ObservableString(min));
pastLatest.setEndsAt(new ObservableString(minPlus5));
assertEquals(1, DateService.compareEventDates(PAST, pastLatest));
}
use of org.fossasia.openevent.app.data.models.dto.ObservableString in project open-event-orga-app by fossasia.
the class DateServiceTest method testClashUpcoming.
@Test
public void testClashUpcoming() {
Event upcomingEarliest = new Event();
String max = DateUtils.formatDateToIso(LocalDateTime.MAX);
String maxMinus5 = DateUtils.formatDateToIso(LocalDateTime.MAX.minusDays(5));
upcomingEarliest.setStartsAt(new ObservableString(maxMinus5));
upcomingEarliest.setEndsAt(new ObservableString(max));
assertEquals(1, DateService.compareEventDates(UPCOMING, upcomingEarliest));
}
use of org.fossasia.openevent.app.data.models.dto.ObservableString in project open-event-orga-app by fossasia.
the class TypeConverterTest method testObservableStringToStringJsonConversion.
@Test
public void testObservableStringToStringJsonConversion() throws JsonProcessingException {
TestModel model = new TestModel(new ObservableString("John Wick"));
String json = OBJECT_MAPPER.writeValueAsString(model);
assertNotNull(json);
assertEquals("{\"name\":\"John Wick\"}", json);
}
use of org.fossasia.openevent.app.data.models.dto.ObservableString in project open-event-orga-app by fossasia.
the class TypeConverterTest method testObservableStringToStringDbConversion.
@Test
public void testObservableStringToStringDbConversion() {
String value = "John Wick";
ObservableString observableString = new ObservableString(value);
assertEquals(value, STRING_CONVERTER.getDBValue(observableString));
}
Aggregations