teller-android / com.levibostian.teller.testing.cachestate / OnlineCacheStateTesting

OnlineCacheStateTesting

class OnlineCacheStateTesting

Convenient utility to generate instances of OnlineCacheState used for testing purposes.

You can use this class directly, or, use the recommended extension functions in the OnlineCacheState.Testing object.

Intentions of OnlineCacheStateTesting:

  1. Be able to initialize an instance of OnlineCacheState with 1 line of code.
  2. Immutable. Represent a snapshot of OnlineCacheState without the ability to edit it.

Types

CacheExistsDsl

class CacheExistsDsl<CACHE>

NoCacheExistsDsl

class NoCacheExistsDsl

Companion Object Functions

cache

fun <CACHE> cache(requirements: GetCacheRequirements, lastTimeFetched: Date, more: CacheExistsDsl<CACHE>.() -> Unit = null): OnlineCacheState<CACHE>

noCache

fun <CACHE> noCache(requirements: GetCacheRequirements, more: NoCacheExistsDsl.() -> Unit = null): OnlineCacheState<CACHE>

none

fun <CACHE> none(): OnlineCacheState<CACHE>