下面列出了java.time.LocalTime#until ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time1.until(time2, unit);
assertEquals(amount, expected);
}
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit_negated(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time2.until(time1, unit);
assertEquals(amount, -expected);
}
@Test(expectedExceptions=DateTimeException.class)
public void test_until_invalidType() {
LocalTime start = LocalTime.of(11, 30);
start.until(LocalDate.of(2010, 6, 30), SECONDS);
}
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time1.until(time2, unit);
assertEquals(amount, expected);
}
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time1.until(time2, unit);
assertEquals(amount, expected);
}
@Test(expectedExceptions=DateTimeException.class)
public void test_until_invalidType() {
LocalTime start = LocalTime.of(11, 30);
start.until(LocalDate.of(2010, 6, 30), SECONDS);
}
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time1.until(time2, unit);
assertEquals(amount, expected);
}
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit_negated(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time2.until(time1, unit);
assertEquals(amount, -expected);
}
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit_negated(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time2.until(time1, unit);
assertEquals(amount, -expected);
}
@Test()
@UseDataProvider("data_periodUntilUnit")
public void test_until_TemporalUnit(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time1.until(time2, unit);
assertEquals(amount, expected);
}
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit_negated(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time2.until(time1, unit);
assertEquals(amount, -expected);
}
@Test(expectedExceptions=DateTimeException.class)
public void test_until_invalidType() {
LocalTime start = LocalTime.of(11, 30);
start.until(LocalDate.of(2010, 6, 30), SECONDS);
}
@Test()
@UseDataProvider("data_periodUntilUnit")
public void test_until_TemporalUnit_negated(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time2.until(time1, unit);
assertEquals(amount, -expected);
}
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit_negated(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time2.until(time1, unit);
assertEquals(amount, -expected);
}
@Test(expectedExceptions=DateTimeException.class)
public void test_until_invalidType() {
LocalTime start = LocalTime.of(11, 30);
start.until(LocalDate.of(2010, 6, 30), SECONDS);
}
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time1.until(time2, unit);
assertEquals(amount, expected);
}
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit_negated(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time2.until(time1, unit);
assertEquals(amount, -expected);
}
@Test(expectedExceptions=DateTimeException.class)
public void test_until_invalidType() {
LocalTime start = LocalTime.of(11, 30);
start.until(LocalDate.of(2010, 6, 30), SECONDS);
}
@Test(dataProvider="periodUntilUnit")
public void test_until_TemporalUnit(LocalTime time1, LocalTime time2, TemporalUnit unit, long expected) {
long amount = time1.until(time2, unit);
assertEquals(amount, expected);
}
@Test(expectedExceptions=DateTimeException.class)
public void test_until_invalidType() {
LocalTime start = LocalTime.of(11, 30);
start.until(LocalDate.of(2010, 6, 30), SECONDS);
}