File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
cycle-module/src/test/kotlin/org.koin.example
main/kotlin/org/koin/example/animal
test/kotlin/org.koin.example Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ import org.koin.example.cycle.CycleModule
77import org.koin.example.cycle.LazyCycleModule
88import org.koin.ksp.generated.*
99
10- class TestModule {
10+ class CycleTestModule {
1111
1212 @Test
13- fun testApp () {
13+ fun cycleTestApp () {
1414 koinApplication {
1515 printLogger(Level .DEBUG )
1616 // else let's use our modules
Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ import kotlin.random.Random
55
66public interface Animal
77
8- @Single(binds = [])
8+ @Single
99public class Dog : Animal
1010
11- @Single(binds = [])
11+ @Single
1212public class Cat : Animal
1313
1414public class Bunny (public val color : String ) : Animal
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import org.koin.example.supertype.D
3737import org.koin.example.supertype.SuperTypesModule
3838import org.koin.ksp.generated.defaultModule
3939import org.koin.ksp.generated.module
40+ import kotlin.random.Random
4041import kotlin.test.assertEquals
4142import kotlin.test.assertFailsWith
4243import kotlin.test.assertNotNull
@@ -131,7 +132,8 @@ class TestModule {
131132
132133
133134 private fun randomGetAnimal (koin : Koin ): Animal {
134- val a = koin.get<Animal >()
135+ val animals = koin.getAll<Animal >()
136+ val a = animals[Random .nextInt(animals.size)]
135137 println (" animal: $a " )
136138 return a
137139 }
You can’t perform that action at this time.
0 commit comments