Skip to content

Commit

Permalink
✅ Add tests to UseIOModules (input and output)
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Colman Lopes <[email protected]>
  • Loading branch information
LeoColman committed Jan 29, 2025
1 parent 5f076c2 commit ccb53cb
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package br.com.colman.petals.use.io.input

import android.content.ContentResolver
import br.com.colman.petals.use.repository.UseRepository
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldNotBe
import io.mockk.mockk
import org.koin.dsl.koinApplication
import org.koin.dsl.module

class UseInputModuleTest : FunSpec({

val koin = koinApplication {
modules(
UseInputModule,
module {
single { mockk<UseRepository>() }
single { mockk<ContentResolver>() }
}
)
}.koin

test("Should resolve an UseCsvFileImporter") {
koin.get<UseCsvFileImporter>() shouldNotBe null
}

test("Should resolve an UseImporter") {
koin.get<UseImporter>() shouldNotBe null
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package br.com.colman.petals.use.io.output

import android.content.Context
import android.content.res.Resources
import br.com.colman.petals.use.repository.UseRepository
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldNotBe
import io.mockk.mockk
import org.koin.dsl.koinApplication
import org.koin.dsl.module

class UseOutputModuleTest : FunSpec({
val koin = koinApplication {
modules(
UseOutputModule,
module {
single { mockk<UseRepository>() }
single { mockk<Resources>(relaxed = true) }
single { mockk<Context>() }
}
)
}.koin

test("Should resolve UseCSVHeaders") {
koin.get<UseCsvHeaders>() shouldNotBe null
}

test("Should resolve UseCsvSerializer") {
koin.get<UseCsvSerializer>() shouldNotBe null
}

test("Should resolve FileWriter") {
koin.get<FileWriter>() shouldNotBe null
}

test("Should resolve UseExporter") {
koin.get<UseExporter>() shouldNotBe null
}
})

0 comments on commit ccb53cb

Please sign in to comment.