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