use of java.time.Period in project j2objc by google.
the class TCKPeriod method test_plusMonths_overflowTooSmall.
@Test(expected = ArithmeticException.class)
public void test_plusMonths_overflowTooSmall() {
Period test = Period.ofMonths(Integer.MIN_VALUE);
test.plusMonths(-1);
}
use of java.time.Period in project j2objc by google.
the class TCKPeriod method test_Period_getUnits.
// -----------------------------------------------------------------------
// get units
// -----------------------------------------------------------------------
@Test
public void test_Period_getUnits() {
Period period = Period.of(2012, 1, 1);
List<TemporalUnit> units = period.getUnits();
assertEquals("Period.getUnits should return 3 units", units.size(), 3);
assertEquals("Period.getUnits contains ChronoUnit.YEARS", units.get(0), ChronoUnit.YEARS);
assertEquals("Period.getUnits contains ChronoUnit.MONTHS", units.get(1), ChronoUnit.MONTHS);
assertEquals("Period.getUnits contains ChronoUnit.DAYS", units.get(2), ChronoUnit.DAYS);
}
use of java.time.Period in project j2objc by google.
the class TCKPeriod method test_minusYears_overflowTooSmall.
@Test(expected = ArithmeticException.class)
public void test_minusYears_overflowTooSmall() {
Period test = Period.ofYears(Integer.MIN_VALUE);
test.minusYears(1);
}
use of java.time.Period in project j2objc by google.
the class TCKPeriod method test_minusDays_overflowTooSmall.
@Test(expected = ArithmeticException.class)
public void test_minusDays_overflowTooSmall() {
Period test = Period.ofDays(Integer.MIN_VALUE);
test.minusDays(1);
}
use of java.time.Period in project j2objc by google.
the class TCKPeriod method test_equals_null.
public void test_equals_null() {
Period test = Period.of(1, 2, 3);
assertEquals(test.equals(null), false);
}
Aggregations