All Downloads are FREE. Search and download functionalities are using the official Maven repository.

androidUnitTest.com.algolia.instantsearch.insights.MockLocalRepository.kt Maven / Gradle / Ivy

Go to download

InstantSearch Android is a library providing widgets and helpers to help you build the best instant-search experience on Android with Algolia. It is built on top of Algolia's Kotlin API Client to provide you a high-level solution to quickly build various search interfaces.

There is a newer version: 3.3.1
Show newest version
package com.algolia.instantsearch.insights

import com.algolia.instantsearch.insights.internal.data.local.InsightsLocalRepository
import com.algolia.search.model.insights.InsightsEvent

internal class MockLocalRepository(
    private val events: MutableList,
) : InsightsLocalRepository {

    override fun append(event: InsightsEvent) {
        events.add(event)
    }

    override fun overwrite(events: List) {
        clear()
        this.events += events
    }

    override fun read(): List {
        return events
    }

    override fun count(): Int {
        return events.size
    }

    override fun clear() {
        events.clear()
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy