All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy