Skip to content

Commit

Permalink
convert several tests to utilize kotlin-test
Browse files Browse the repository at this point in the history
  • Loading branch information
frett committed Oct 15, 2023
1 parent 385abec commit e4e1024
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import io.mockk.coVerify
import io.mockk.confirmVerified
import io.mockk.excludeRecords
import io.mockk.mockk
import kotlin.test.Test
import kotlin.test.assertTrue
import org.cru.godtools.BuildConfig
import org.cru.godtools.R
import org.junit.Assert.assertTrue
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.annotation.Config

Expand Down Expand Up @@ -102,7 +102,7 @@ class AppUpdateSnackbarTest {
)
}
confirmVerified(snackbarHostState)
assertTrue("Default to Flexible Update", appUpdateManager.isConfirmationDialogVisible)
assertTrue(appUpdateManager.isConfirmationDialogVisible, "Default to Flexible Update")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import android.content.Context
import io.mockk.every
import io.mockk.mockk
import java.io.File
import kotlin.test.BeforeTest
import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test

class FileSystemTest {
Expand All @@ -16,7 +16,7 @@ class FileSystemTest {

private lateinit var fileSystem: FileSystem

@Before
@BeforeTest
fun setup() {
fileSystem = FileSystem(context, "resources")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package org.cru.godtools.base

import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import kotlin.test.BeforeTest
import kotlin.test.Test
import org.cru.godtools.base.Settings.Companion.FEATURE_TUTORIAL_ONBOARDING
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith

private const val FEATURE_TEST = "testFeature"
Expand All @@ -16,7 +16,7 @@ private const val FEATURE_TEST = "testFeature"
class SettingsTest {
private lateinit var settings: Settings

@Before
@BeforeTest
fun setup() {
settings = Settings(ApplicationProvider.getApplicationContext())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import io.mockk.mockk
import io.mockk.verify
import java.util.Locale
import kotlin.random.Random
import kotlin.test.BeforeTest
import kotlin.test.Test
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.annotation.Config

Expand All @@ -23,7 +23,7 @@ private const val PACKAGE_NAME = "packageName"
class LocaleUtilsGetDisplayNameTest {
lateinit var context: Context

@Before
@BeforeTest
fun setup() {
context = mockk {
every { packageName } returns PACKAGE_NAME
Expand Down

0 comments on commit e4e1024

Please sign in to comment.