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

commonTest.selectable.TestSelectableItemViewModel.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 selectable

import com.algolia.instantsearch.core.selectable.SelectableItemViewModel
import shouldBeFalse
import shouldBeTrue
import kotlin.test.Test

class TestSelectableItemViewModel {

    private val valueA = "valueA"

    @Test
    fun selection() {
        SelectableItemViewModel(valueA).apply {
            eventSelection.subscribe { isSelected.value = it }
            isSelected.value.shouldBeFalse()
            eventSelection.send(true)
            isSelected.value.shouldBeTrue()
            eventSelection.send(false)
            isSelected.value.shouldBeFalse()
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy