Include dateUtil in test

This commit is contained in:
Philoul 2022-06-17 22:01:42 +02:00
parent d06d5f6b02
commit 73e4933251
2 changed files with 6 additions and 3 deletions

View file

@ -56,10 +56,10 @@ class CRDatum {
var isEqual = true var isEqual = true
if (crInitialIOB != obj.crInitialIOB) isEqual = false if (crInitialIOB != obj.crInitialIOB) isEqual = false
if (crInitialBG != obj.crInitialBG) isEqual = false if (crInitialBG != obj.crInitialBG) isEqual = false
//if (crInitialCarbTime / 1000 != obj.crInitialCarbTime / 1000) isEqual = false if (crInitialCarbTime / 1000 != obj.crInitialCarbTime / 1000) isEqual = false
if (crEndIOB != obj.crEndIOB) isEqual = false if (crEndIOB != obj.crEndIOB) isEqual = false
if (crEndBG != obj.crEndBG) isEqual = false if (crEndBG != obj.crEndBG) isEqual = false
//if (crEndTime / 1000 != obj.crEndTime / 1000) isEqual = false if (crEndTime / 1000 != obj.crEndTime / 1000) isEqual = false
if (crCarbs != obj.crCarbs) isEqual = false if (crCarbs != obj.crCarbs) isEqual = false
if (crInsulin != obj.crInsulin) isEqual = false if (crInsulin != obj.crInsulin) isEqual = false
return isEqual return isEqual

View file

@ -1,5 +1,6 @@
package info.nightscout.androidaps.plugins.general.autotune package info.nightscout.androidaps.plugins.general.autotune
import android.content.Context
import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.TestBase
import info.nightscout.androidaps.plugins.general.autotune.data.* import info.nightscout.androidaps.plugins.general.autotune.data.*
import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DateUtil
@ -11,12 +12,14 @@ import org.mockito.Mock
import java.io.File import java.io.File
class PreppedGlucoseTest : TestBase() { class PreppedGlucoseTest : TestBase() {
@Mock lateinit var dateUtil: DateUtil @Mock lateinit var context: Context
lateinit var dateUtil: DateUtil
lateinit var prep1: PreppedGlucose lateinit var prep1: PreppedGlucose
lateinit var prepjson1: String lateinit var prepjson1: String
@Before @Before
fun initData() { fun initData() {
dateUtil = DateUtil(context)
prepjson1 = File("src/test/res/autotune/test1/autotune.2022-05-21.json").readText() prepjson1 = File("src/test/res/autotune/test1/autotune.2022-05-21.json").readText()
prep1 = PreppedGlucose(JSONObject(prepjson1), dateUtil) prep1 = PreppedGlucose(JSONObject(prepjson1), dateUtil)
} }