use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_withMonth.
//-----------------------------------------------------------------------
// withMonth()
//-----------------------------------------------------------------------
@Test
public void test_withMonth() {
YearMonth test = YearMonth.of(2008, 6);
assertEquals(test.withMonth(1), YearMonth.of(2008, 1));
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_withMonth_int_noChange_equal.
@Test
public void test_withMonth_int_noChange_equal() {
YearMonth test = YearMonth.of(2008, 6);
assertEquals(test.withMonth(6), test);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_minusYears_long_invalidTooSmall.
@Test(expectedExceptions = DateTimeException.class)
public void test_minusYears_long_invalidTooSmall() {
YearMonth test = YearMonth.of(Year.MIN_VALUE, 6);
test.minusYears(1);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_minusYears_long.
//-----------------------------------------------------------------------
// minusYears()
//-----------------------------------------------------------------------
@Test
public void test_minusYears_long() {
YearMonth test = YearMonth.of(2008, 6);
assertEquals(test.minusYears(1), YearMonth.of(2007, 6));
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_minusMonths_long_negativeOverYear.
@Test
public void test_minusMonths_long_negativeOverYear() {
YearMonth test = YearMonth.of(2008, 6);
assertEquals(test.minusMonths(-7), YearMonth.of(2009, 1));
}
Aggregations