use of io.spine.time.ZoneOffset in project core-java by SpineEventEngine.
the class TimeChangesShould method create_OffsetDateChange_instance.
@Test
public void create_OffsetDateChange_instance() {
final ZoneOffset inKiev = ZoneOffsets.ofHours(3);
final ZoneOffset inLuxembourg = ZoneOffsets.ofHours(1);
final OffsetDate previousDate = OffsetDates.now(inKiev);
final OffsetDate newDate = OffsetDates.now(inLuxembourg);
final OffsetDateChange result = TimeChanges.of(previousDate, newDate);
assertEquals(previousDate, result.getPreviousValue());
assertEquals(newDate, result.getNewValue());
}
use of io.spine.time.ZoneOffset in project core-java by SpineEventEngine.
the class ChangesShould method create_OffsetDateTimeChange_instance.
@Test
public void create_OffsetDateTimeChange_instance() {
final ZoneOffset inKiev = ZoneOffsets.ofHours(3);
final ZoneOffset inLuxembourg = ZoneOffsets.ofHours(1);
final OffsetDateTime previousDateTime = OffsetDateTimes.now(inKiev);
final OffsetDateTime newDateTime = OffsetDateTimes.now(inLuxembourg);
final OffsetDateTimeChange result = Changes.of(previousDateTime, newDateTime);
assertEquals(previousDateTime, result.getPreviousValue());
assertEquals(newDateTime, result.getNewValue());
}
use of io.spine.time.ZoneOffset in project core-java by SpineEventEngine.
the class ChangesShould method do_not_accept_equal_OffsetDate_values.
@Test(expected = IllegalArgumentException.class)
public void do_not_accept_equal_OffsetDate_values() {
final ZoneOffset inLuxembourg = ZoneOffsets.ofHours(1);
final OffsetDate date = OffsetDates.now(inLuxembourg);
Changes.of(date, date);
}
use of io.spine.time.ZoneOffset in project core-java by SpineEventEngine.
the class ChangesShould method do_not_accept_equal_OffsetTime_values.
@Test(expected = IllegalArgumentException.class)
public void do_not_accept_equal_OffsetTime_values() {
final ZoneOffset inLuxembourg = ZoneOffsets.ofHours(1);
final OffsetTime now = OffsetTimes.now(inLuxembourg);
Changes.of(now, now);
}
use of io.spine.time.ZoneOffset in project core-java by SpineEventEngine.
the class ChangesShould method do_not_accept_null_OffsetTime_previousValue.
@Test(expected = NullPointerException.class)
public void do_not_accept_null_OffsetTime_previousValue() {
final ZoneOffset inLassVegas = ZoneOffsets.ofHours(8);
final OffsetTime now = OffsetTimes.now(inLassVegas);
Changes.of(null, now);
}
Aggregations