use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKLocalDate method test_minus_Period_invalidTooSmall.
@Test(expectedExceptions = DateTimeException.class)
public void test_minus_Period_invalidTooSmall() {
MockSimplePeriod period = MockSimplePeriod.of(1, ChronoUnit.YEARS);
LocalDate.of(Year.MIN_VALUE, 1, 1).minus(period);
}
use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKOffsetDateTime method test_minus_Period.
//-----------------------------------------------------------------------
// minus(Period)
//-----------------------------------------------------------------------
@Test
public void test_minus_Period() {
MockSimplePeriod period = MockSimplePeriod.of(7, ChronoUnit.MONTHS);
OffsetDateTime t = TEST_2008_6_30_11_30_59_000000500.minus(period);
assertEquals(t, OffsetDateTime.of(2007, 11, 30, 11, 30, 59, 500, OFFSET_PONE));
}
use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method test_minus_MinusAdjuster.
//-----------------------------------------------------------------------
// minus(MinusAdjuster)
//-----------------------------------------------------------------------
@Test
public void test_minus_MinusAdjuster() {
MockSimplePeriod period = MockSimplePeriod.of(7, ChronoUnit.MINUTES);
OffsetTime t = TEST_11_30_59_500_PONE.minus(period);
assertEquals(t, OffsetTime.of(11, 23, 59, 500, OFFSET_PONE));
}
use of test.java.time.MockSimplePeriod in project jdk8u_jdk by JetBrains.
the class TCKOffsetTime method test_plus_PlusAdjuster.
//-----------------------------------------------------------------------
// plus(PlusAdjuster)
//-----------------------------------------------------------------------
@Test
public void test_plus_PlusAdjuster() {
MockSimplePeriod period = MockSimplePeriod.of(7, ChronoUnit.MINUTES);
OffsetTime t = TEST_11_30_59_500_PONE.plus(period);
assertEquals(t, OffsetTime.of(11, 37, 59, 500, OFFSET_PONE));
}
Aggregations