Skip to content

Commit 8f049d3

Browse files
committed
Fix: Unit test imports - use JUnit Assert instead of kotlin.test
1 parent 52576a7 commit 8f049d3

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

app/src/test/java/com/appcontrolx/executor/RootExecutorTest.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package com.appcontrolx.executor
22

3+
import org.junit.Assert.assertTrue
34
import org.junit.Before
45
import org.junit.Test
5-
import kotlin.test.assertFalse
6-
import kotlin.test.assertTrue
76

87
class RootExecutorTest {
98

app/src/test/java/com/appcontrolx/presentation/viewmodel/AppListViewModelTest.kt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import kotlinx.coroutines.test.setMain
1313
import org.junit.After
1414
import org.junit.Before
1515
import org.junit.Test
16+
import org.junit.Assert.assertEquals
17+
import org.junit.Assert.assertTrue
1618
import org.mockito.kotlin.mock
1719
import org.mockito.kotlin.whenever
18-
import kotlin.test.assertEquals
19-
import kotlin.test.assertTrue
2020

2121
@OptIn(ExperimentalCoroutinesApi::class)
2222
class AppListViewModelTest {
@@ -62,8 +62,9 @@ class AppListViewModelTest {
6262

6363
val success = awaitItem()
6464
assertTrue(success is AppListUiState.Success)
65-
assertEquals(1, success.apps.size)
66-
assertEquals("Test App", success.apps[0].appName)
65+
val successState = success as AppListUiState.Success
66+
assertEquals(1, successState.apps.size)
67+
assertEquals("Test App", successState.apps[0].appName)
6768
}
6869
}
6970

@@ -84,7 +85,8 @@ class AppListViewModelTest {
8485

8586
val errorState = awaitItem()
8687
assertTrue(errorState is AppListUiState.Error)
87-
assertEquals("Network error", errorState.message)
88+
val error = errorState as AppListUiState.Error
89+
assertEquals("Network error", error.message)
8890
}
8991
}
9092

app/src/test/java/com/appcontrolx/utils/SafetyValidatorTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.appcontrolx.utils
22

3+
import org.junit.Assert.assertFalse
4+
import org.junit.Assert.assertTrue
35
import org.junit.Test
4-
import kotlin.test.assertFalse
5-
import kotlin.test.assertTrue
66

77
class SafetyValidatorTest {
88

0 commit comments

Comments
 (0)