Rewrites ActionDummyTest with matchers

Issue #2745
This commit is contained in:
Ryan Haining 2023-10-04 21:41:27 -07:00
parent 89a9329c6d
commit efb18e35e3

View file

@ -1,20 +1,20 @@
package app.aaps.plugins.automation.actions
import kotlin.test.assertIs
import org.json.JSONObject
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
class ActionDummyTest : ActionsTestBase() {
@Test
fun instantiateTest() {
var action: Action? = ActionDummy(injector).instantiate(JSONObject("{\"type\":\"info.nightscout.androidaps.plugins.general.automation.actions.ActionDummy\"}"))
Assertions.assertTrue(action is ActionDummy)
var action: Action? = ActionDummy(injector).instantiate(JSONObject("""{"type":"info.nightscout.androidaps.plugins.general.automation.actions.ActionDummy"}"""))
assertIs<ActionDummy>(action)
action = ActionDummy(injector).instantiate(JSONObject("{\"type\":\"app.aaps.plugins.automation.actions.ActionDummy\"}"))
Assertions.assertTrue(action is ActionDummy)
action = ActionDummy(injector).instantiate(JSONObject("""{"type":"app.aaps.plugins.automation.actions.ActionDummy"}"""))
assertIs<ActionDummy>(action)
action = ActionDummy(injector).instantiate(JSONObject("{\"type\":\"ActionDummy\"}"))
Assertions.assertTrue(action is ActionDummy)
action = ActionDummy(injector).instantiate(JSONObject("""{"type":"ActionDummy"}"""))
assertIs<ActionDummy>(action)
}
}
}