Skip to content

Commit

Permalink
[#354] We should use a verb to start a func name -> "setUp"
Browse files Browse the repository at this point in the history
  • Loading branch information
luongvo committed Feb 13, 2023
1 parent e973b93 commit c80193a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class HomeScreenTest {
private var expectedAppDestination: AppDestination? = null

@Before
fun setup() {
fun setUp() {
every { mockUseCase() } returns flowOf(
listOf(Model(1), Model(2), Model(3))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import io.mockk.mockk
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.test.runTest
import org.junit.Before
import org.junit.Test
import kotlinx.coroutines.test.runTest

@ExperimentalCoroutinesApi
class RepositoryTest {
Expand All @@ -23,7 +23,7 @@ class RepositoryTest {
private val response = Response(id = 1)

@Before
fun setup() {
fun setUp() {
mockService = mockk()
repository = RepositoryImpl(mockService)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package co.nimblehq.sample.compose.domain.usecase
import co.nimblehq.sample.compose.domain.model.Model
import co.nimblehq.sample.compose.domain.repository.Repository
import io.kotest.matchers.shouldBe
import io.mockk.*
import io.mockk.every
import io.mockk.mockk
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.test.runTest
Expand All @@ -19,7 +20,7 @@ class UseCaseTest {
private val model = Model(id = 1)

@Before
fun setup() {
fun setUp() {
mockRepository = mockk()
useCase = UseCase(mockRepository)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HomeScreenTest {
private var expectedAppDestination: AppDestination? = null

@Before
fun setup() {
fun setUp() {
composeRule.activity.setContent {
HomeScreen(
navigator = { destination -> expectedAppDestination = destination }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RepositoryTest {
private val response = Response(id = 1)

@Before
fun setup() {
fun setUp() {
mockService = mockk()
repository = RepositoryImpl(mockService)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UseCaseTest {
private val model = Model(id = 1)

@Before
fun setup() {
fun setUp() {
mockRepository = mockk()
useCase = UseCase(mockRepository)
}
Expand Down

0 comments on commit c80193a

Please sign in to comment.