Skip to content

Commit 8bbd9d5

Browse files
author
sentinelweb
committed
457 fix db tests
1 parent 59fa239 commit 8bbd9d5

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

app/src/test/kotlin/uk/co/sentinelweb/cuer/app/util/prefs/SharedPrefsWrapperRoboTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,4 @@ class SharedPrefsWrapperRoboTest {
147147
private val X1_FIRST = "testId.first"
148148
private val X1_SECOND = "testId.second"
149149
}
150-
}
150+
}

database/src/androidUnitTest/kotlin/uk/co/sentinelweb/cuer/db/util/MultiPlatformPreferencesWrapperDbTestImpl.kt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ class MultiPlatformPreferencesWrapperDbTestImpl : MultiPlatformPreferencesWrappe
2323
} else throw IllegalStateException("not implemented")
2424
}
2525

26+
override fun getFloat(field: MultiPlatformPreferences): Float? =
27+
if (DATABASE_VERSION == field) {
28+
map.get(field) as? Float
29+
} else throw IllegalStateException("not implemented")
30+
31+
override fun getFloat(field: MultiPlatformPreferences, def: Float): Float =
32+
if (DATABASE_VERSION == field) {
33+
map.get(field) as? Float ?: def
34+
} else throw IllegalStateException("not implemented")
35+
36+
override fun putFloat(field: MultiPlatformPreferences, value: Float) {
37+
if (DATABASE_VERSION == field) {
38+
map.put(field, value)
39+
} else throw IllegalStateException("not implemented")
40+
}
41+
2642
override fun getString(field: MultiPlatformPreferences, def: String?): String? {
2743
TODO("Not yet implemented")
2844
}
@@ -87,4 +103,4 @@ class MultiPlatformPreferencesWrapperDbTestImpl : MultiPlatformPreferencesWrappe
87103
TODO("Not yet implemented")
88104
}
89105

90-
}
106+
}

0 commit comments

Comments
 (0)