facebook twitter hatena line email

Android/kotlin/UnitTest/coroutines

提供: 初心者エンジニアの簡易メモ
移動: 案内検索

app/build.gradle

dependencies {
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2"
}

ExampleUnitTest.kt

import kotlinx.coroutines.runBlocking
import org.junit.Test

import org.junit.Assert.*

class ExampleUnitTest {
    @Test
    fun addition_isCorrect_coroutines() = runBlocking {
        assertEquals(4, 2 + 2)
    }
}