diff --git a/src/test/java/de/ctdo/bunti/model/BuntiDMXDeviceTest.java b/src/test/java/de/ctdo/bunti/model/BuntiDMXDeviceTest.java index f0eb728..7906270 100644 --- a/src/test/java/de/ctdo/bunti/model/BuntiDMXDeviceTest.java +++ b/src/test/java/de/ctdo/bunti/model/BuntiDMXDeviceTest.java @@ -13,11 +13,12 @@ import static org.junit.Assert.assertEquals; public class BuntiDMXDeviceTest { private static final int STARTADDRESS = 42; + private static final int DEVICEID = 23; BuntiDMXDevice dut; @Before public void setUp() throws Exception { - dut = new Par56Spot(23,STARTADDRESS,"device"); + dut = new Par56Spot(DEVICEID,STARTADDRESS,"device"); } @Test @@ -88,6 +89,11 @@ public class BuntiDMXDeviceTest { assertEquals(dut.getChannelValueByName("nonexistent"),0 ); } + @Test + public void testGetChannelValueWrong2() throws Exception { + assertEquals(dut.getChannelValueByName(null), 0); + } + private Map createOptions() { Map options = new HashMap(); options.put("blue", 99); @@ -131,8 +137,14 @@ public class BuntiDMXDeviceTest { } @Test - public void testSetDeviceName() throws Exception { + public void testSetDeviceName() throws Exception { dut.setDeviceName("rapunzel"); assertEquals("rapunzel", dut.getDeviceName()); } + + @Test + public void testGetDeviceId() throws Exception { + assertEquals(DEVICEID, dut.getDeviceId()); + } + }