fix tests

This commit is contained in:
johan12345
2024-04-24 21:53:26 +02:00
parent 45de4c8ff0
commit ed4be05aed
3 changed files with 11 additions and 11 deletions

View File

@@ -67,7 +67,7 @@ class NewMotionAvailabilityDetectorTest {
fun apiTest() {
for (chargepoint in listOf(2105L, 18284L)) {
val charger = runBlocking { api.getChargepointDetail(chargepoint).body()!! }
.chargelocations[0].convert("", true) as ChargeLocation
.chargelocations!![0].convert("", true) as ChargeLocation
println(charger)
runBlocking {

View File

@@ -60,7 +60,7 @@ class ChargepriceApiTest {
fun apiTest() {
for (chargepoint in listOf(2105L, 18284L)) {
val charger = runBlocking { ge.getChargepointDetail(chargepoint).body()!! }
.chargelocations[0].convert("", true) as ChargeLocation
.chargelocations!![0].convert("", true) as ChargeLocation
println(charger)
runBlocking {

View File

@@ -63,8 +63,8 @@ class GoingElectricApiTest {
val body = response.body()!!
assertEquals("ok", body.status)
assertEquals(null, body.startkey)
assertEquals(1, body.chargelocations.size)
val charger = body.chargelocations[0] as GEChargeLocation
assertEquals(1, body.chargelocations!!.size)
val charger = body.chargelocations!![0] as GEChargeLocation
assertEquals(2105, charger.id)
}
@@ -75,8 +75,8 @@ class GoingElectricApiTest {
val body = response.body()!!
assertEquals("ok", body.status)
assertEquals(null, body.startkey)
assertEquals(1, body.chargelocations.size)
val charger = body.chargelocations[0] as GEChargeLocation
assertEquals(1, body.chargelocations!!.size)
val charger = body.chargelocations!![0] as GEChargeLocation
assertEquals(34210, charger.id)
assertEquals(LocalTime.MIN, charger.openinghours!!.days!!.monday.start)
assertEquals(LocalTime.MAX, charger.openinghours!!.days!!.monday.end)
@@ -92,8 +92,8 @@ class GoingElectricApiTest {
val body = response.body()!!
assertEquals("ok", body.status)
assertEquals(null, body.startkey)
assertEquals(2, body.chargelocations.size)
val charger = body.chargelocations[0] as GEChargeLocation
assertEquals(2, body.chargelocations!!.size)
val charger = body.chargelocations!![0] as GEChargeLocation
assertEquals(41161, charger.id)
}
@@ -106,7 +106,7 @@ class GoingElectricApiTest {
val body = response.body()!!
assertEquals("ok", body.status)
assertEquals(null, body.startkey)
assertEquals(0, body.chargelocations.size)
assertEquals(0, body.chargelocations!!.size)
}
@Test
@@ -118,8 +118,8 @@ class GoingElectricApiTest {
val body = response.body()!!
assertEquals("ok", body.status)
assertEquals(2, body.startkey)
assertEquals(2, body.chargelocations.size)
val charger = body.chargelocations[0] as GEChargeLocation
assertEquals(2, body.chargelocations!!.size)
val charger = body.chargelocations!![0] as GEChargeLocation
assertEquals(41161, charger.id)
}
}