From ed4be05aedd5e00e98984f5ba0e1967e0896c5b4 Mon Sep 17 00:00:00 2001 From: johan12345 Date: Wed, 24 Apr 2024 21:53:26 +0200 Subject: [PATCH] fix tests --- .../NewMotionAvailabilityDetectorTest.kt | 2 +- .../api/chargeprice/ChargepriceApiTest.kt | 2 +- .../api/goingelectric/GoingElectricApiTest.kt | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/src/test/java/net/vonforst/evmap/api/availability/NewMotionAvailabilityDetectorTest.kt b/app/src/test/java/net/vonforst/evmap/api/availability/NewMotionAvailabilityDetectorTest.kt index aa4cc5cb..ff0e7651 100644 --- a/app/src/test/java/net/vonforst/evmap/api/availability/NewMotionAvailabilityDetectorTest.kt +++ b/app/src/test/java/net/vonforst/evmap/api/availability/NewMotionAvailabilityDetectorTest.kt @@ -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 { diff --git a/app/src/test/java/net/vonforst/evmap/api/chargeprice/ChargepriceApiTest.kt b/app/src/test/java/net/vonforst/evmap/api/chargeprice/ChargepriceApiTest.kt index ee22e1b9..b967a485 100644 --- a/app/src/test/java/net/vonforst/evmap/api/chargeprice/ChargepriceApiTest.kt +++ b/app/src/test/java/net/vonforst/evmap/api/chargeprice/ChargepriceApiTest.kt @@ -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 { diff --git a/app/src/test/java/net/vonforst/evmap/api/goingelectric/GoingElectricApiTest.kt b/app/src/test/java/net/vonforst/evmap/api/goingelectric/GoingElectricApiTest.kt index bd24e9e5..ef833b8b 100644 --- a/app/src/test/java/net/vonforst/evmap/api/goingelectric/GoingElectricApiTest.kt +++ b/app/src/test/java/net/vonforst/evmap/api/goingelectric/GoingElectricApiTest.kt @@ -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) } } \ No newline at end of file