Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
Philoul committed May 8, 2024
1 parent 19afd31 commit baa2c5d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions app/src/androidTest/kotlin/app/aaps/ReplayApsResultsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -769,19 +769,19 @@ class ReplayApsResultsTest @Inject constructor() {
// aapsLogger.debug(LTag.APS, resultKt.reason.toString())
aapsLogger.debug(LTag.APS, "File: $filename")
// // assertThat(resultKt.reason.toString()).isEqualTo(result?.json?.getString("reason"))
assertThat(resultKt.tick ?: "").isEqualTo(result?.json()?.optString("tick"))
assertThat(resultKt.eventualBG ?: 0.0).isWithin(1.0).of(result?.json()?.optDouble("eventualBG") ?:0.0)
assertThat(resultKt.targetBG ?: Double.NaN).isEqualTo(result?.json()?.optDouble("targetBG"))
assertThat(resultKt.insulinReq ?: Double.NaN).isEqualTo(result?.json()?.optDouble("insulinReq"))
assertThat(resultKt.carbsReq ?: 0).isEqualTo(result?.json()?.optInt("carbsReq"))
assertThat(resultKt.carbsReqWithin ?: 0).isEqualTo(result?.json()?.optInt("carbsReqWithin"))
assertThat(resultKt.units ?: Double.NaN).isEqualTo(result?.json()?.optDouble("units"))
assertThat(resultKt.sensitivityRatio ?: Double.NaN).isEqualTo(result?.json()?.optDouble("sensitivityRatio"))
assertThat(resultKt.duration ?: 0).isEqualTo(result?.json()?.optInt("duration"))
assertThat(resultKt.rate ?: Double.NaN).isEqualTo(result?.json()?.optDouble("rate"))
assertThat(resultKt.COB ?: Double.NaN).isEqualTo(result?.json()?.optDouble("COB"))
assertThat(resultKt.IOB ?: Double.NaN).isEqualTo(result?.json()?.optDouble("IOB"))
assertThat(resultKt.variable_sens ?: Double.NaN).isEqualTo(result?.json()?.optDouble("variable_sens"))
assertThat(resultKt.tick ?: "").isEqualTo(result.json()?.optString("tick"))
assertThat(resultKt.eventualBG ?: 0.0).isWithin(1.0).of(result.json()?.optDouble("eventualBG") ?: 0.0)
assertThat(resultKt.targetBG ?: Double.NaN).isEqualTo(result.json()?.optDouble("targetBG"))
assertThat(resultKt.insulinReq ?: Double.NaN).isEqualTo(result.json()?.optDouble("insulinReq"))
assertThat(resultKt.carbsReq ?: 0).isEqualTo(result.json()?.optInt("carbsReq"))
assertThat(resultKt.carbsReqWithin ?: 0).isEqualTo(result.json()?.optInt("carbsReqWithin"))
assertThat(resultKt.units ?: Double.NaN).isEqualTo(result.json()?.optDouble("units"))
assertThat(resultKt.sensitivityRatio ?: Double.NaN).isEqualTo(result.json()?.optDouble("sensitivityRatio"))
assertThat(resultKt.duration ?: 0).isEqualTo(result.json()?.optInt("duration"))
assertThat(resultKt.rate ?: Double.NaN).isEqualTo(result.json()?.optDouble("rate"))
assertThat(resultKt.COB ?: Double.NaN).isEqualTo(result.json()?.optDouble("COB"))
assertThat(resultKt.IOB ?: Double.NaN).isEqualTo(result.json()?.optDouble("IOB"))
assertThat(resultKt.variable_sens ?: Double.NaN).isEqualTo(result.json()?.optDouble("variable_sens"))
}

enum class TestSource { ASSET, FILE }
Expand Down

0 comments on commit baa2c5d

Please sign in to comment.