Пример #1
0
 @Test
 public void durationBetween3() {
   Timestamp reference = Timestamp.of(10, 500000000);
   assertThat(
       reference.durationBetween(reference.plus(TimeDuration.ofMillis(600))),
       equalTo(TimeDuration.ofMillis(600)));
 }
Пример #2
0
 @Test
 public void durationBetween1() {
   Timestamp reference = Timestamp.now();
   assertThat(
       reference.durationBetween(reference.plus(TimeDuration.ofNanos(10))),
       equalTo(TimeDuration.ofNanos(10)));
 }
Пример #3
0
 @Test
 public void plus4() {
   Timestamp time = Timestamp.of(100, 750000000);
   Timestamp newTime = time.plus(TimeDuration.ofSeconds(-5.750));
   assertThat(newTime, equalTo(Timestamp.of(95, 000000000)));
 }
Пример #4
0
 @Test
 public void plus2() {
   Timestamp time = Timestamp.of(100, 100000000);
   Timestamp newTime = time.plus(TimeDuration.ofNanos(999000000));
   assertThat(newTime, equalTo(Timestamp.of(101, 99000000)));
 }
Пример #5
0
 @Test
 public void plus1() {
   Timestamp time = Timestamp.of(0, 0);
   Timestamp newTime = time.plus(TimeDuration.ofMillis(100));
   assertThat(newTime, equalTo(Timestamp.of(0, 100000000)));
 }