Rewrites ComparatorExistsTest with matchers

Issue #2745
This commit is contained in:
Ryan Haining 2023-10-04 20:59:28 -07:00
parent f8b0404cc3
commit 11fa9f6539

View file

@ -1,18 +1,18 @@
package app.aaps.plugins.automation.elements
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
class ComparatorExistsTest : TriggerTestBase() {
@Test fun labelsTest() {
Assertions.assertEquals(2, ComparatorExists.Compare.labels(rh).size)
assertThat(ComparatorExists.Compare.labels(rh)).hasSize(2)
}
@Test fun setValueTest() {
val c = ComparatorExists(rh)
c.value = ComparatorExists.Compare.NOT_EXISTS
Assertions.assertEquals(ComparatorExists.Compare.NOT_EXISTS, c.value)
assertThat(c.value).isEqualTo(ComparatorExists.Compare.NOT_EXISTS)
}
}
}