Skip to content

Commit b020f18

Browse files
committed
[FIX/#351] assertion 함수 변경
1 parent a4ba12d commit b020f18

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

core/designsystem/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,4 @@ dependencies {
2323
implementation(libs.lottie)
2424
implementation(libs.coil.compose)
2525
implementation(libs.coil.network.okhttp)
26-
27-
testImplementation(libs.bundles.androidx.compose.ui.test)
2826
}

feature/intern/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ dependencies {
1515
// feature
1616
implementation(projects.feature.dialog)
1717

18+
testImplementation(projects.core.testing)
1819
}

feature/intern/src/test/java/com/terning/intern/InternViewModelTest.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@ import com.terning.core.designsystem.state.UiState
44
import com.terning.domain.intern.entity.InternInfo
55
import com.terning.domain.intern.repository.InternRepository
66
import com.terning.feature.intern.InternViewModel
7-
import com.watcha.testing.util.MainDispatcherRule
8-
import kotlinx.coroutines.ExperimentalCoroutinesApi
7+
import com.terning.testing.util.MainDispatcherRule
8+
import junit.framework.TestCase.assertEquals
9+
import junit.framework.TestCase.assertTrue
910
import kotlinx.coroutines.flow.first
10-
import kotlinx.coroutines.test.advanceUntilIdle
1111
import kotlinx.coroutines.test.runTest
1212
import org.junit.Before
1313
import org.junit.Rule
1414
import org.junit.Test
1515
import org.mockito.Mockito.doReturn
1616
import org.mockito.Mockito.mock
1717

18-
@OptIn(ExperimentalCoroutinesApi::class)
1918
class InternViewModelTest {
2019

2120
@get:Rule
@@ -55,8 +54,8 @@ class InternViewModelTest {
5554
viewModel.getInternInfo(1)
5655

5756
val uiState = viewModel.internUiState.first()
58-
assert(uiState.loadState is UiState.Success)
59-
assert((uiState.loadState as UiState.Success).data == mockInternInfo)
57+
assertTrue(uiState.loadState is UiState.Success)
58+
assertEquals((uiState.loadState as UiState.Success).data, mockInternInfo)
6059
}
6160

6261
}

0 commit comments

Comments
 (0)