// Path: src/main/java/com/google/code/tempusfugit/temporal/Duration.java
// public static Duration seconds(long seconds) {
//     validate(seconds, TimeUnit.SECONDS);
//     return new Duration(seconds, TimeUnit.SECONDS);
// }


import org.junit.Test;
import java.util.Date;
import static com.google.code.tempusfugit.temporal.Duration.seconds;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
/*
 * Copyright (c) 2009-2018, toby weston & tempus-fugit committers
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 *
 *      http://www.apache.org/licenses/LICENSE-2.0 
 *
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 */

package com.google.code.tempusfugit.temporal;




public class MovableClockTest {

    private final MovableClock clock = new MovableClock();

    @Test
    public void dateStartsAtZero() {
        assertThat(clock.now().getTime(), is(0L));
    }

    @Test
    public void dateCanMoveOn() {
        clock.incrementBy(seconds(1));
        assertThat(clock.now().getTime(), is(1000L));
        clock.incrementBy(seconds(2));
        assertThat(clock.now().getTime(), is(3000L));
        clock.incrementBy(seconds(3));
        assertThat(clock.now().getTime(), is(6000L));
    }

    @Test
    public void setTime() {
// Path: src/main/java/com/google/code/tempusfugit/temporal/Duration.java
// public static Duration seconds(long seconds) {
//     validate(seconds, TimeUnit.SECONDS);
//     return new Duration(seconds, TimeUnit.SECONDS);
// }


// Path: src/test/java/com/google/code/tempusfugit/temporal/MovableClockTest.java
import org.junit.Test;
import java.util.Date;
import static com.google.code.tempusfugit.temporal.Duration.seconds;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

/*
 * Copyright (c) 2009-2018, toby weston & tempus-fugit committers
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at 
 *
 *      http://www.apache.org/licenses/LICENSE-2.0 
 *
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and 
 * limitations under the License.
 */

package com.google.code.tempusfugit.temporal;




public class MovableClockTest {

    private final MovableClock clock = new MovableClock();

    @Test
    public void dateStartsAtZero() {
        assertThat(clock.now().getTime(), is(0L));
    }

    @Test
    public void dateCanMoveOn() {
        clock.incrementBy(seconds(1));
        assertThat(clock.now().getTime(), is(1000L));
        clock.incrementBy(seconds(2));
        assertThat(clock.now().getTime(), is(3000L));
        clock.incrementBy(seconds(3));
        assertThat(clock.now().getTime(), is(6000L));
    }

    @Test
    public void setTime() {
        clock.setTime(seconds(1));