use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TestLocalDate method test_minus_longPeriodUnit_zero.
@Test
public void test_minus_longPeriodUnit_zero() {
LocalDate t = TEST_2007_07_15.minus(0, ChronoUnit.DAYS);
assertSame(t, TEST_2007_07_15);
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TestLocalDate method test_minusWeeks_symmetry.
@Test(dataProvider = "sampleMinusWeeksSymmetry")
public void test_minusWeeks_symmetry(LocalDate reference) {
for (int weeks = 0; weeks < 365 * 8; weeks++) {
LocalDate t = reference.minusWeeks(weeks).minusWeeks(-weeks);
assertEquals(t, reference);
t = reference.minusWeeks(-weeks).minusWeeks(weeks);
assertEquals(t, reference);
}
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TestLocalDate method test_plus_longPeriodUnit_zero.
@Test
public void test_plus_longPeriodUnit_zero() {
LocalDate t = TEST_2007_07_15.plus(0, ChronoUnit.DAYS);
assertSame(t, TEST_2007_07_15);
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TestLocalDate method test_minusDays_noChange_same.
@Test
public void test_minusDays_noChange_same() {
LocalDate t = TEST_2007_07_15.minusDays(0);
assertSame(t, TEST_2007_07_15);
}
use of java.time.LocalDate in project jdk8u_jdk by JetBrains.
the class TestLocalDate method test_plusDays_symmetry.
@Test(dataProvider = "samplePlusDaysSymmetry")
public void test_plusDays_symmetry(LocalDate reference) {
for (int days = 0; days < 365 * 8; days++) {
LocalDate t = reference.plusDays(days).plusDays(-days);
assertEquals(t, reference);
t = reference.plusDays(-days).plusDays(days);
assertEquals(t, reference);
}
}
Aggregations