package com.ponzischeme89.memby.data

import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test

class PlayablePrefetchTest {
    @Test
    fun `launch accepts only a recent focus prefetch`() {
        val now = 100_000L

        assertTrue(isFreshPlayablePrefetch(now - PLAYABLE_PREFETCH_MAX_AGE_MS, now))
        assertFalse(isFreshPlayablePrefetch(now - PLAYABLE_PREFETCH_MAX_AGE_MS - 1L, now))
        assertFalse(isFreshPlayablePrefetch(now + 1L, now))
    }
}
