-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Add tests to UseIOModules (input and output)
Signed-off-by: Leonardo Colman Lopes <[email protected]>
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
app/src/test/kotlin/br/com/colman/petals/use/io/input/UseInputModuleTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
}) |
39 changes: 39 additions & 0 deletions
39
app/src/test/kotlin/br/com/colman/petals/use/io/output/UseOutputModuleTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
}) |