本文整理匯總了Java中java.time.LocalDate.datesUntil方法的典型用法代碼示例。如果您正苦於以下問題:Java LocalDate.datesUntil方法的具體用法?Java LocalDate.datesUntil怎麽用?Java LocalDate.datesUntil使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.time.LocalDate
的用法示例。
在下文中一共展示了LocalDate.datesUntil方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: test_datesUntil_staticType
import java.time.LocalDate; //導入方法依賴的package包/類
@Test
public void test_datesUntil_staticType() {
// Test the types of the Stream and elements of the stream
LocalDate date = date(2015, 2, 10);
Stream<LocalDate> stream = date.datesUntil(date.plusDays(5));
long sum = stream.mapToInt(LocalDate::getDayOfMonth).sum();
assertEquals(sum, 60, "sum of 10, 11, 12, 13, 14 is wrong");
}
示例2: test_datesUntil_nullEnd
import java.time.LocalDate; //導入方法依賴的package包/類
@Test(expectedExceptions=NullPointerException.class)
public void test_datesUntil_nullEnd() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(null);
}
示例3: test_datesUntil_nullEndStep
import java.time.LocalDate; //導入方法依賴的package包/類
@Test(expectedExceptions=NullPointerException.class)
public void test_datesUntil_nullEndStep() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(null, Period.ofDays(1));
}
示例4: test_datesUntil_nullStep
import java.time.LocalDate; //導入方法依賴的package包/類
@Test(expectedExceptions=NullPointerException.class)
public void test_datesUntil_nullStep() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(date, null);
}
示例5: test_datesUntil_zeroStep
import java.time.LocalDate; //導入方法依賴的package包/類
@Test(expectedExceptions=IllegalArgumentException.class)
public void test_datesUntil_zeroStep() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(date, Period.ZERO);
}
示例6: test_datesUntil_oppositeSign
import java.time.LocalDate; //導入方法依賴的package包/類
@Test(expectedExceptions=IllegalArgumentException.class)
public void test_datesUntil_oppositeSign() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(date, Period.of(1, 0, -1));
}
示例7: test_datesUntil_oppositeSign2
import java.time.LocalDate; //導入方法依賴的package包/類
@Test(expectedExceptions=IllegalArgumentException.class)
public void test_datesUntil_oppositeSign2() {
LocalDate date = date(2015, 1, 31);
date.datesUntil(date, Period.of(0, -1, 1));
}