diff --git a/src/test/java/de/ctdo/bunti/model/BuntiDMXDeviceTest.java b/src/test/java/de/ctdo/bunti/model/BuntiDMXDeviceTest.java index 245789a..6db28f1 100644 --- a/src/test/java/de/ctdo/bunti/model/BuntiDMXDeviceTest.java +++ b/src/test/java/de/ctdo/bunti/model/BuntiDMXDeviceTest.java @@ -88,19 +88,28 @@ public class BuntiDMXDeviceTest { assertEquals(dut.getChannelValueByName("nonexistent"),0 ); } - @Test - public void testGetChannelData() throws Exception { + private Map createOptions() { Map options = new HashMap(); options.put("blue", 99); options.put("red", 66); options.put("green", 77); options.put("speed", 111); options.put("mode", 222); + return options; + } - assertTrue(dut.setValuesFromOptions(options)); - + @Test + public void testGetChannelDataCount() throws Exception { + dut.setValuesFromOptions(createOptions()); Map channelData = dut.getChannelData(); assertEquals(channelData.size(), 5); + } + + @Test + public void testGetChannelDataOrder() throws Exception { + dut.setValuesFromOptions(createOptions()); + + Map channelData = dut.getChannelData(); assertEquals(new Integer(222), channelData.get(STARTADDRESS + 0 + DMX.DMX_STARTADDRESS_OFFSET)); assertEquals(new Integer(66), channelData.get(STARTADDRESS + 1 + DMX.DMX_STARTADDRESS_OFFSET)); @@ -116,4 +125,14 @@ public class BuntiDMXDeviceTest { assertEquals(6, channelData.size()); } + @Test + public void testGetLastChanged() throws Exception { + assert(dut.getLastChanged() > 0); + } + + @Test + public void testSetDeviceName() throws Exception { + dut.setDeviceName("rapunzel"); + assertEquals("rapunzel", dut.getDeviceName()); + } }