use of java.time.Clock in project j2objc by google.
the class TCKClock_Offset method test_equals.
// -----------------------------------------------------------------------
public void test_equals() {
Clock a = Clock.offset(Clock.system(PARIS), OFFSET);
Clock b = Clock.offset(Clock.system(PARIS), OFFSET);
assertEquals(a.equals(a), true);
assertEquals(a.equals(b), true);
assertEquals(b.equals(a), true);
assertEquals(b.equals(b), true);
Clock c = Clock.offset(Clock.system(MOSCOW), OFFSET);
assertEquals(a.equals(c), false);
Clock d = Clock.offset(Clock.system(PARIS), OFFSET.minusNanos(1));
assertEquals(a.equals(d), false);
assertEquals(a.equals(null), false);
assertEquals(a.equals("other type"), false);
assertEquals(a.equals(Clock.systemUTC()), false);
}
use of java.time.Clock in project j2objc by google.
the class TCKClock_Offset method test_withZone_equal.
public void test_withZone_equal() {
Clock test = Clock.offset(Clock.system(PARIS), OFFSET);
Clock changed = test.withZone(PARIS);
assertEquals(test, changed);
}
use of java.time.Clock in project j2objc by google.
the class TCKClock_System method test_system_ZoneId.
public void test_system_ZoneId() {
Clock test = Clock.system(PARIS);
assertEquals(test.getZone(), PARIS);
}
use of java.time.Clock in project j2objc by google.
the class TCKClock_System method test_systemUTC.
// -------------------------------------------------------------------------
public void test_systemUTC() {
Clock test = Clock.systemUTC();
assertEquals(test.getZone(), ZoneOffset.UTC);
assertEquals(test, Clock.system(ZoneOffset.UTC));
}
use of java.time.Clock in project j2objc by google.
the class TCKClock_Tick method test_withZone.
// -------------------------------------------------------------------------
public void test_withZone() {
Clock test = Clock.tick(Clock.system(PARIS), Duration.ofMillis(500));
Clock changed = test.withZone(MOSCOW);
assertEquals(test.getZone(), PARIS);
assertEquals(changed.getZone(), MOSCOW);
}
Aggregations