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

commonTest.Test.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
import kotlin.reflect.KClass
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertFalse
import kotlin.test.assertNotEquals
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlin.test.assertTrue

internal infix fun  T.shouldEqual(expected: T) {
    assertEquals(expected, this)
}

internal infix fun  T.shouldNotEqual(expected: T) {
    assertNotEquals(expected, this)
}

internal fun Any?.shouldBeNull() {
    assertNull(this)
}

internal fun Any?.shouldNotBeNull() {
    assertNotNull(this)
}

internal fun Boolean.shouldBeTrue() {
    assertTrue(this)
}

internal fun Boolean.shouldBeFalse() {
    assertFalse(this)
}

internal infix fun  Collection.shouldEqual(collection: Collection) {
    assertEquals(collection, this)
}

internal infix fun  Collection.shouldNotEqual(collection: Collection) {
    assertNotEquals(collection, this)
}

internal fun  Collection.shouldBeEmpty() {
    this.isEmpty().shouldBeTrue()
}

internal fun  Collection.shouldNotBeEmpty() {
    this.isNotEmpty().shouldBeTrue()
}

internal infix fun  Collection.shouldContain(element: T) {
    this.contains(element)
}

internal infix fun  KClass.shouldFailWith(block: suspend () -> Unit): T {
    return assertFailsWith(this, null) {
        blocking {
            block()
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy