LoopPluginTest without powermock
This commit is contained in:
parent
ed30e2bf10
commit
8ec991c3d7
6 changed files with 5 additions and 12 deletions
|
@ -40,7 +40,7 @@ import javax.inject.Singleton
|
|||
import kotlin.math.min
|
||||
|
||||
@Singleton
|
||||
class VirtualPumpPlugin @Inject constructor(
|
||||
open class VirtualPumpPlugin @Inject constructor(
|
||||
injector: HasAndroidInjector,
|
||||
aapsLogger: AAPSLogger,
|
||||
private val rxBus: RxBusWrapper,
|
||||
|
|
|
@ -27,16 +27,9 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP
|
|||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mockito.Mock
|
||||
import org.mockito.Mockito.`when`
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest
|
||||
import org.powermock.modules.junit4.PowerMockRunner
|
||||
|
||||
@RunWith(PowerMockRunner::class)
|
||||
@PrepareForTest(
|
||||
ConstraintChecker::class, VirtualPumpPlugin::class, FabricPrivacy::class, ReceiverStatusStore::class,
|
||||
IobCobCalculatorPlugin::class, AppRepository::class)
|
||||
class LoopPluginTest : TestBase() {
|
||||
|
||||
@Mock lateinit var sp: SP
|
||||
|
|
|
@ -10,7 +10,7 @@ import javax.inject.Inject
|
|||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class ConstraintChecker @Inject constructor(private val activePlugin: ActivePluginProvider) : ConstraintsInterface {
|
||||
open class ConstraintChecker @Inject constructor(private val activePlugin: ActivePluginProvider) : ConstraintsInterface {
|
||||
|
||||
fun isLoopInvocationAllowed(): Constraint<Boolean> =
|
||||
isLoopInvocationAllowed(Constraint(true))
|
||||
|
|
|
@ -9,7 +9,7 @@ import javax.inject.Inject
|
|||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class ReceiverStatusStore @Inject constructor(val context: Context, val rxBus: RxBusWrapper) {
|
||||
open class ReceiverStatusStore @Inject constructor(val context: Context, val rxBus: RxBusWrapper) {
|
||||
|
||||
var lastNetworkEvent: EventNetworkChange? = null
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import javax.inject.Singleton
|
|||
* emulates the methods but ignores the request if the instance is null or invalid.
|
||||
*/
|
||||
@Singleton
|
||||
class FabricPrivacy @Inject constructor(
|
||||
open class FabricPrivacy @Inject constructor(
|
||||
private val aapsLogger: AAPSLogger,
|
||||
private val sp: SP
|
||||
) {
|
||||
|
|
|
@ -18,7 +18,7 @@ import javax.inject.Inject
|
|||
import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class AppRepository @Inject internal constructor(
|
||||
open class AppRepository @Inject internal constructor(
|
||||
internal val database: AppDatabase
|
||||
) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue