test wifi SSID with space in automation

This commit is contained in:
Milos Kozak 2023-03-29 09:50:50 +02:00
parent 06ece9747c
commit ec12dd8e91

View file

@ -22,16 +22,16 @@ class TriggerWifiSsidTest : TriggerTestBase() {
@Test fun shouldRunTest() { @Test fun shouldRunTest() {
val e = EventNetworkChange() val e = EventNetworkChange()
`when`(receiverStatusStore.lastNetworkEvent).thenReturn(e) `when`(receiverStatusStore.lastNetworkEvent).thenReturn(e)
var t: TriggerWifiSsid = TriggerWifiSsid(injector).setValue("aSSID").comparator(Comparator.Compare.IS_EQUAL) var t: TriggerWifiSsid = TriggerWifiSsid(injector).setValue("aSSID 1").comparator(Comparator.Compare.IS_EQUAL)
e.wifiConnected = false e.wifiConnected = false
Assert.assertFalse(t.shouldRun()) Assert.assertFalse(t.shouldRun())
e.wifiConnected = true e.wifiConnected = true
e.ssid = "otherSSID" e.ssid = "otherSSID"
Assert.assertFalse(t.shouldRun()) Assert.assertFalse(t.shouldRun())
e.wifiConnected = true e.wifiConnected = true
e.ssid = "aSSID" e.ssid = "aSSID 1"
Assert.assertTrue(t.shouldRun()) Assert.assertTrue(t.shouldRun())
t = TriggerWifiSsid(injector).setValue("aSSID").comparator(Comparator.Compare.IS_NOT_AVAILABLE) t = TriggerWifiSsid(injector).setValue("aSSID 1").comparator(Comparator.Compare.IS_NOT_AVAILABLE)
e.wifiConnected = false e.wifiConnected = false
Assert.assertTrue(t.shouldRun()) Assert.assertTrue(t.shouldRun())