// Path: src/main/java/uk/ac/ic/wlgitbridge/bridge/db/ProjectState.java
// public enum ProjectState {
// 
//     NOT_PRESENT,
//     PRESENT,
//     SWAPPED
// 
// }


import org.junit.Before;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import uk.ac.ic.wlgitbridge.bridge.db.ProjectState;
import java.io.IOException;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
        dbStore.setLastAccessedTime(
                "asdf",
                Timestamp.valueOf(LocalDateTime.now())
        );
        assertEquals("asdf", dbStore.getOldestUnswappedProject());
    }

    @Test
    public void testGetNumUnswappedProjects() {
        dbStore.setLatestVersionForProject("asdf", 1);
        dbStore.setLastAccessedTime(
                "asdf",
                Timestamp.valueOf(LocalDateTime.now())
        );
        assertEquals(1, dbStore.getNumUnswappedProjects());
        dbStore.setLastAccessedTime(
                "asdf",
                null
        );
        assertEquals(0, dbStore.getNumUnswappedProjects());
    }

    @Test
    public void projectStateIsNotPresentIfNotInDBAtAll() {
        assertEquals(
                ProjectState.NOT_PRESENT,
                dbStore.getProjectState("asdf")
        );
    }

// Path: src/main/java/uk/ac/ic/wlgitbridge/bridge/db/ProjectState.java
// public enum ProjectState {
// 
//     NOT_PRESENT,
//     PRESENT,
//     SWAPPED
// 
// }


// Path: src/test/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/SqliteDBStoreTest.java
import org.junit.Before;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import uk.ac.ic.wlgitbridge.bridge.db.ProjectState;
import java.io.IOException;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

        dbStore.setLastAccessedTime(
                "asdf",
                Timestamp.valueOf(LocalDateTime.now())
        );
        assertEquals("asdf", dbStore.getOldestUnswappedProject());
    }

    @Test
    public void testGetNumUnswappedProjects() {
        dbStore.setLatestVersionForProject("asdf", 1);
        dbStore.setLastAccessedTime(
                "asdf",
                Timestamp.valueOf(LocalDateTime.now())
        );
        assertEquals(1, dbStore.getNumUnswappedProjects());
        dbStore.setLastAccessedTime(
                "asdf",
                null
        );
        assertEquals(0, dbStore.getNumUnswappedProjects());
    }

    @Test
    public void projectStateIsNotPresentIfNotInDBAtAll() {
        assertEquals(
                ProjectState.NOT_PRESENT,
                dbStore.getProjectState("asdf")
        );
    }

    @Test