fix tests

This commit is contained in:
Milos Kozak 2020-12-06 15:26:59 +01:00
parent 5f3aaf6b54
commit d556678507
2 changed files with 4 additions and 2 deletions

View file

@ -2,6 +2,7 @@ package info.nightscout.androidaps.data
import dagger.android.AndroidInjector
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.R
import info.nightscout.androidaps.TestBase
import info.nightscout.androidaps.plugins.aps.loop.LoopPlugin
import info.nightscout.androidaps.interfaces.ProfileFunction
@ -56,7 +57,7 @@ class QuickWizardTest : TestBase() {
fun mock() {
PowerMockito.mockStatic(Profile::class.java)
PowerMockito.`when`<Any>(Profile::class.java, "secondsFromMidnight").thenReturn(0)
`when`(sp.getString("QuickWizard", "[]")).thenReturn("[]")
`when`(sp.getString(R.string.key_quickwizard, "[]")).thenReturn("[]")
quickWizard = QuickWizard(sp, injector)
}

View file

@ -4,6 +4,7 @@ import android.content.Context
import dagger.Lazy
import dagger.android.AndroidInjector
import dagger.android.HasAndroidInjector
import info.nightscout.androidaps.Config
import info.nightscout.androidaps.R
import info.nightscout.androidaps.TestBase
import info.nightscout.androidaps.interfaces.ActivePluginProvider
@ -60,7 +61,7 @@ class LoopPluginTest : TestBase() {
@Before fun prepareMock() {
hardLimits = HardLimits(aapsLogger, rxBus, sp, resourceHelper, context, nsUpload)
loopPlugin = LoopPlugin(injector, aapsLogger, rxBus, sp, constraintChecker, resourceHelper, profileFunction, context, commandQueue, activePlugin, treatmentsPlugin, virtualPumpPlugin, actionStringHandler, iobCobCalculatorPlugin, receiverStatusStore, fabricPrivacy, nsUpload, hardLimits)
loopPlugin = LoopPlugin(injector, aapsLogger, rxBus, sp, Config(), constraintChecker, resourceHelper, profileFunction, context, commandQueue, activePlugin, treatmentsPlugin, virtualPumpPlugin, actionStringHandler, iobCobCalculatorPlugin, receiverStatusStore, fabricPrivacy, nsUpload, hardLimits)
`when`(activePlugin.activePump).thenReturn(virtualPumpPlugin)
}