Skip to content

Commit

Permalink
Assert returned result
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuwu committed Oct 11, 2023
1 parent ebfc2bd commit 7726fa9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import dev.arkbuilders.navigator.presentation.App
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.runner.RunWith
import org.mockito.junit.MockitoJUnitRunner
import java.io.File
import java.nio.file.Path
import java.nio.file.Paths
import kotlin.io.path.name

@RunWith(MockitoJUnitRunner::class)
class DevicePathsExtractorTest {
Expand Down Expand Up @@ -39,12 +41,14 @@ class DevicePathsExtractorTest {

val directoryIterator: MutableIterator<Path> = arrayListOf(
Paths.get("PATH")

).iterator()
every { mockedPath.iterator() } returns directoryIterator

testee.listDevices()
val result = testee.listDevices()

verify { mockedApplication.getExternalFilesDirs(null) }
assertEquals(1, result.size)
assertEquals("PATH", result[0].name)
}

}

0 comments on commit 7726fa9

Please sign in to comment.