Rewrites StaticLabelTest with matchers

Issue #2745
This commit is contained in:
Ryan Haining 2023-10-04 20:43:51 -07:00
parent 7d4cd89cec
commit 06b219aade

View file

@ -2,7 +2,7 @@ package app.aaps.plugins.automation.elements
import app.aaps.plugins.automation.triggers.TriggerDummy
import app.aaps.plugins.automation.triggers.TriggerTestBase
import org.junit.jupiter.api.Assertions
import com.google.common.truth.Truth.assertThat
import org.junit.jupiter.api.Test
import org.mockito.Mockito.`when`
@ -10,9 +10,9 @@ class StaticLabelTest : TriggerTestBase() {
@Test fun constructor() {
var sl = StaticLabel(rh, "any", TriggerDummy(injector))
Assertions.assertEquals("any", sl.label)
assertThat(sl.label).isEqualTo("any")
`when`(rh.gs(app.aaps.core.ui.R.string.pumplimit)).thenReturn("pump limit")
sl = StaticLabel(rh, app.aaps.core.ui.R.string.pumplimit, TriggerDummy(injector))
Assertions.assertEquals("pump limit", sl.label)
assertThat(sl.label).isEqualTo("pump limit")
}
}
}