Rewrites ActionLoopDisableTest with matchers

Issue #2745
This commit is contained in:
Ryan Haining 2023-10-04 21:51:00 -07:00
parent 3172b3c265
commit 3a88e89a80

View file

@ -3,7 +3,7 @@ package app.aaps.plugins.automation.actions
import app.aaps.core.interfaces.plugin.PluginType import app.aaps.core.interfaces.plugin.PluginType
import app.aaps.core.interfaces.queue.Callback import app.aaps.core.interfaces.queue.Callback
import app.aaps.plugins.automation.R import app.aaps.plugins.automation.R
import org.junit.jupiter.api.Assertions import com.google.common.truth.Truth.assertThat
import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test
import org.mockito.ArgumentMatchers.eq import org.mockito.ArgumentMatchers.eq
@ -27,17 +27,17 @@ class ActionLoopDisableTest : ActionsTestBase() {
@Test @Test
fun friendlyNameTest() { fun friendlyNameTest() {
Assertions.assertEquals(app.aaps.core.ui.R.string.disableloop, sut.friendlyName()) assertThat(sut.friendlyName()).isEqualTo(app.aaps.core.ui.R.string.disableloop)
} }
@Test @Test
fun shortDescriptionTest() { fun shortDescriptionTest() {
Assertions.assertEquals("Disable loop", sut.shortDescription()) assertThat(sut.shortDescription()).isEqualTo("Disable loop")
} }
@Test @Test
fun iconTest() { fun iconTest() {
Assertions.assertEquals(R.drawable.ic_stop_24dp, sut.icon()) assertThat(sut.icon()).isEqualTo(R.drawable.ic_stop_24dp)
} }
@Test @Test
@ -60,4 +60,4 @@ class ActionLoopDisableTest : ActionsTestBase() {
Mockito.verify(configBuilder, Mockito.times(1)).storeSettings("ActionLoopDisable") Mockito.verify(configBuilder, Mockito.times(1)).storeSettings("ActionLoopDisable")
Mockito.verify(commandQueue, Mockito.times(1)).cancelTempBasal(eq(true), anyObject()) Mockito.verify(commandQueue, Mockito.times(1)).cancelTempBasal(eq(true), anyObject())
} }
} }