Rewrites ActionStopProcessingTest with matchers

Issue #2745
This commit is contained in:
Ryan Haining 2023-10-04 21:48:57 -07:00
parent db16ded981
commit ab93dbe33e

View file

@ -2,7 +2,7 @@ package app.aaps.plugins.automation.actions
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.Mockito.`when` import org.mockito.Mockito.`when`
@ -20,25 +20,25 @@ class ActionStopProcessingTest : ActionsTestBase() {
@Test @Test
fun friendlyNameTest() { fun friendlyNameTest() {
Assertions.assertEquals(R.string.stop_processing, sut.friendlyName()) assertThat(sut.friendlyName()).isEqualTo(R.string.stop_processing)
} }
@Test @Test
fun shortDescriptionTest() { fun shortDescriptionTest() {
Assertions.assertEquals("Stop processing", sut.shortDescription()) assertThat(sut.shortDescription()).isEqualTo("Stop processing")
} }
@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
fun doActionTest() { fun doActionTest() {
sut.doAction(object : Callback() { sut.doAction(object : Callback() {
override fun run() { override fun run() {
Assertions.assertTrue(result.success) assertThat(result.success).isTrue()
} }
}) })
} }
} }