use of org.openhab.binding.dmx.DmxService in project openhab1-addons by openhab.
the class DmxSwitchItemTest method switchesOnWhenOnCommandReceived.
@Test
public void switchesOnWhenOnCommandReceived() throws BindingConfigParseException {
DmxItem item = getValidInstance();
DmxService service = Mockito.mock(DmxService.class);
item.processCommand(service, OnOffType.ON);
Mockito.verify(service).enableChannel(3);
Mockito.verify(service).enableChannel(4);
}
use of org.openhab.binding.dmx.DmxService in project openhab1-addons by openhab.
the class DmxSwitchItemTest method switchesOnToMaxValueWhenOnCommandReceivedAndNoChannelValues.
@Test
public void switchesOnToMaxValueWhenOnCommandReceivedAndNoChannelValues() throws BindingConfigParseException {
DmxItem item = getValidInstance();
DmxService service = Mockito.mock(DmxService.class);
Mockito.when(service.getChannelValue(3)).thenReturn(0);
Mockito.when(service.getChannelValue(4)).thenReturn(0);
item.processCommand(service, OnOffType.ON);
Mockito.verify(service).enableChannel(3);
Mockito.verify(service).enableChannel(4);
Mockito.verify(service).setChannelValue(3, 255);
Mockito.verify(service).setChannelValue(4, 255);
}
Aggregations