From afa64d0111f2d603903290782163638a3d96a95b Mon Sep 17 00:00:00 2001 From: Philoul Date: Thu, 18 Mar 2021 23:01:31 +0100 Subject: [PATCH] Try to fix test, Probably a bit better but doesn't work --- .../maintenance/formats/ClassicPrefsFormatTest.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/ClassicPrefsFormatTest.kt b/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/ClassicPrefsFormatTest.kt index 6bf6560187..3cea8b551e 100644 --- a/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/ClassicPrefsFormatTest.kt +++ b/core/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/formats/ClassicPrefsFormatTest.kt @@ -1,8 +1,10 @@ package info.nightscout.androidaps.plugins.general.maintenance.formats import info.nightscout.androidaps.TestBase +import info.nightscout.androidaps.interfaces.ProfileFunction +import info.nightscout.androidaps.utils.DateUtil +import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP import org.junit.Assert import org.junit.Test import org.junit.runner.RunWith @@ -18,14 +20,16 @@ import java.io.File class ClassicPrefsFormatTest : TestBase() { @Mock lateinit var resourceHelper: ResourceHelper - @Mock lateinit var sp: SP + @Mock lateinit var dateUtil: DateUtil + @Mock lateinit var translator: Translator + @Mock lateinit var profileFunction: ProfileFunction @Mock lateinit var file: MockedFile @Test fun preferenceLoadingTest() { val test = "key1::val1\nkeyB::valB" - val classicFormat = ClassicPrefsFormat(resourceHelper, SingleStringStorage(test)) + val classicFormat = ClassicPrefsFormat(resourceHelper, dateUtil, translator, profileFunction, SingleStringStorage(test)) val prefs = classicFormat.loadPreferences(getMockedFile(), "") Assert.assertEquals(prefs.values.size, 2) @@ -37,7 +41,7 @@ class ClassicPrefsFormatTest : TestBase() { @Test fun preferenceSavingTest() { val storage = SingleStringStorage("") - val classicFormat = ClassicPrefsFormat(resourceHelper, storage) + val classicFormat = ClassicPrefsFormat(resourceHelper, dateUtil, translator, profileFunction, storage) val prefs = Prefs( mapOf( "key1" to "A",