Rewrites TriggerDummyTest with matchers

Issue #2745
This commit is contained in:
Ryan Haining 2023-10-04 22:37:55 -07:00
parent 3aafe1212a
commit 570e3adea5

View file

@ -1,7 +1,7 @@
package app.aaps.plugins.automation.triggers
import kotlin.test.assertIs
import org.json.JSONObject
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class TriggerDummyTest : TriggerTestBase() {
@ -9,13 +9,13 @@ class TriggerDummyTest : TriggerTestBase() {
@Test
fun instantiateTest() {
var trigger: Trigger? = TriggerDummy(injector).instantiate(JSONObject("{\"data\":{},\"type\":\"info.nightscout.androidaps.plugins.general.automation.triggers.TriggerDummy\"}"))
Assertions.assertTrue(trigger is TriggerDummy)
assertIs<TriggerDummy>(trigger)
trigger = TriggerDummy(injector).instantiate(JSONObject("{\"data\":{},\"type\":\"app.aaps.plugins.automation.triggers.TriggerDummy\"}"))
Assertions.assertTrue(trigger is TriggerDummy)
assertIs<TriggerDummy>(trigger)
trigger = TriggerDummy(injector).instantiate(JSONObject("{\"data\":{},\"type\":\"TriggerDummy\"}"))
Assertions.assertTrue(trigger is TriggerDummy)
assertIs<TriggerDummy>(trigger)
}
}
}