update unit tests after API module restructuring

This commit is contained in:
johan12345
2021-07-09 16:14:09 +02:00
parent 1296e66902
commit 110c418d01
5 changed files with 10 additions and 10 deletions

View File

@@ -1,10 +1,10 @@
package net.vonforst.evmap.viewmodel
package net.vonforst.evmap.api
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
class FilterViewModelTest {
class UtilsTest {
@Test
fun testPowerMapping() {
val sliderValues = powerSteps.indices.toList()

View File

@@ -1,6 +1,6 @@
package net.vonforst.evmap.api.availability
import net.vonforst.evmap.api.goingelectric.Chargepoint
import net.vonforst.evmap.model.Chargepoint
import org.junit.Assert.assertEquals
import org.junit.Test

View File

@@ -2,8 +2,8 @@ package net.vonforst.evmap.api.availability
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.runBlocking
import net.vonforst.evmap.api.goingelectric.ChargeLocation
import net.vonforst.evmap.api.goingelectric.GoingElectricApi
import net.vonforst.evmap.model.ChargeLocation
import net.vonforst.evmap.okResponse
import okhttp3.OkHttpClient
import okhttp3.mockwebserver.Dispatcher
@@ -67,7 +67,7 @@ class NewMotionAvailabilityDetectorTest {
fun apiTest() {
for (chargepoint in listOf(2105L, 18284L)) {
val charger = runBlocking { api.getChargepointDetail(chargepoint).body()!! }
.chargelocations[0] as ChargeLocation
.chargelocations[0].convert("") as ChargeLocation
println(charger)
runBlocking {

View File

@@ -2,8 +2,8 @@ package net.vonforst.evmap.api.chargeprice
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.runBlocking
import net.vonforst.evmap.api.goingelectric.ChargeLocation
import net.vonforst.evmap.api.goingelectric.GoingElectricApi
import net.vonforst.evmap.model.ChargeLocation
import net.vonforst.evmap.okResponse
import okhttp3.mockwebserver.Dispatcher
import okhttp3.mockwebserver.MockResponse
@@ -58,7 +58,7 @@ class ChargepriceApiTest {
fun apiTest() {
for (chargepoint in listOf(2105L, 18284L)) {
val charger = runBlocking { ge.getChargepointDetail(chargepoint).body()!! }
.chargelocations[0] as ChargeLocation
.chargelocations[0].convert("") as ChargeLocation
println(charger)
runBlocking {

View File

@@ -59,7 +59,7 @@ class GoingElectricApiTest {
assertEquals("ok", body.status)
assertEquals(null, body.startkey)
assertEquals(1, body.chargelocations.size)
val charger = body.chargelocations[0] as ChargeLocation
val charger = body.chargelocations[0] as GEChargeLocation
assertEquals(2105, charger.id)
}
@@ -73,7 +73,7 @@ class GoingElectricApiTest {
assertEquals("ok", body.status)
assertEquals(null, body.startkey)
assertEquals(2, body.chargelocations.size)
val charger = body.chargelocations[0] as ChargeLocation
val charger = body.chargelocations[0] as GEChargeLocation
assertEquals(41161, charger.id)
}
@@ -99,7 +99,7 @@ class GoingElectricApiTest {
assertEquals("ok", body.status)
assertEquals(2, body.startkey)
assertEquals(2, body.chargelocations.size)
val charger = body.chargelocations[0] as ChargeLocation
val charger = body.chargelocations[0] as GEChargeLocation
assertEquals(41161, charger.id)
}
}