How to test this class: class A { val b : B = ...
# koin
t
How to test this class: class A { val b : B = get() }
n
you should use a primary constructor instead to allow easier testing...
t
If it is using the primary constructor then I don't ask this question ...
a
If you are using GlobalContext, you can use KoinTest extension and set up KoinTestRule. In the KoinTestRule definition, you can prepare modules with mock objects or test objects.
t
Thanks, can you give me an example, any url for reference?
Please note that this will only work if you use Global Context.