add test
This commit is contained in:
parent
b5db6e613d
commit
89cf0271e0
|
@ -90,12 +90,13 @@ open class TestBaseWithProfile : TestBase() {
|
|||
json.put("store", store)
|
||||
return ProfileStore(profileInjector, json, dateUtil)
|
||||
}
|
||||
|
||||
fun getInvalidProfileStore2(): ProfileStore {
|
||||
val json = JSONObject()
|
||||
val store = JSONObject()
|
||||
store.put(TESTPROFILENAME, JSONObject(validProfileJSON))
|
||||
store.put("invalid", JSONObject(invalidProfileJSON))
|
||||
json.put("defaultProfile", TESTPROFILENAME)
|
||||
json.put("defaultProfile", TESTPROFILENAME + "invalid")
|
||||
json.put("store", store)
|
||||
return ProfileStore(profileInjector, json, dateUtil)
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package info.nightscout.androidaps.interfaces
|
|||
|
||||
import info.nightscout.androidaps.TestBaseWithProfile
|
||||
import info.nightscout.androidaps.data.PureProfile
|
||||
import org.json.JSONObject
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
|
||||
|
@ -20,6 +21,7 @@ internal class ProfileStoreTest : TestBaseWithProfile() {
|
|||
@Test
|
||||
fun getDefaultProfileJsonTest() {
|
||||
Assert.assertTrue(getValidProfileStore().getDefaultProfileJson()?.has("dia") ?: false)
|
||||
Assert.assertEquals(null, getInvalidProfileStore2().getDefaultProfileJson())
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in a new issue