use of io.spine.time.OffsetTime in project core-java by SpineEventEngine.
the class TimeChangesShould method create_OffsetTimeChange_instance.
@Test
public void create_OffsetTimeChange_instance() {
final ZoneOffset inKiev = ZoneOffsets.ofHours(3);
final ZoneOffset inLuxembourg = ZoneOffsets.ofHours(1);
final OffsetTime previousTime = OffsetTimes.now(inKiev);
final OffsetTime newTime = OffsetTimes.now(inLuxembourg);
final OffsetTimeChange result = TimeChanges.of(previousTime, newTime);
assertEquals(previousTime, result.getPreviousValue());
assertEquals(newTime, result.getNewValue());
}
use of io.spine.time.OffsetTime in project core-java by SpineEventEngine.
the class TimeChangesShould method do_not_accept_null_OffsetTime_newValue.
@Test(expected = NullPointerException.class)
public void do_not_accept_null_OffsetTime_newValue() {
final ZoneOffset inKiev = ZoneOffsets.ofHours(3);
final OffsetTime now = OffsetTimes.now(inKiev);
TimeChanges.of(now, null);
}
use of io.spine.time.OffsetTime in project core-java by SpineEventEngine.
the class TimeChangesShould 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);
TimeChanges.of(null, now);
}
use of io.spine.time.OffsetTime in project core-java by SpineEventEngine.
the class TimeChangesShould 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);
TimeChanges.of(now, now);
}
Aggregations