commonMain.io.mockk.impl.instantiation.CommonInstanceFactoryRegistry.kt Maven / Gradle / Ivy
package io.mockk.impl.instantiation
import io.mockk.MockKGateway.InstanceFactory
import io.mockk.MockKGateway.InstanceFactoryRegistry
import io.mockk.impl.InternalPlatform
class CommonInstanceFactoryRegistry : InstanceFactoryRegistry {
private val factories = InternalPlatform.synchronizedMutableList()
val instanceFactories: List
get() = InternalPlatform.synchronized(factories) {
factories.toList()
}
override fun registerFactory(factory: InstanceFactory) {
factories.add(factory)
}
override fun deregisterFactory(factory: InstanceFactory) {
factories.remove(factory)
}
}