use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_get.
@Test(dataProvider = "sampleDates")
public void test_get(int y, int m) {
YearMonth a = YearMonth.of(y, m);
assertEquals(a.getYear(), y);
assertEquals(a.getMonth(), Month.of(m));
assertEquals(a.getMonthValue(), m);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_minusMonths_long_noChange_equal.
@Test
public void test_minusMonths_long_noChange_equal() {
YearMonth test = YearMonth.of(2008, 6);
assertEquals(test.minusMonths(0), test);
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_plusMonths_long.
//-----------------------------------------------------------------------
// plusMonths()
//-----------------------------------------------------------------------
@Test
public void test_plusMonths_long() {
YearMonth test = YearMonth.of(2008, 6);
assertEquals(test.plusMonths(1), YearMonth.of(2008, 7));
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_plusMonths_long_negative.
@Test
public void test_plusMonths_long_negative() {
YearMonth test = YearMonth.of(2008, 6);
assertEquals(test.plusMonths(-1), YearMonth.of(2008, 5));
}
use of java.time.YearMonth in project jdk8u_jdk by JetBrains.
the class TCKYearMonth method test_minusYears_long_big.
@Test
public void test_minusYears_long_big() {
YearMonth test = YearMonth.of(40, 6);
assertEquals(test.minusYears(20L + Year.MAX_VALUE), YearMonth.of((int) (40L - 20L - Year.MAX_VALUE), 6));
}
Aggregations