From 3deb94652f89287e674a39e0a347053751cb6fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Tue, 6 Mar 2012 18:10:46 +0100 Subject: [PATCH] added deviceId test. and ChannelValueWrong --- .../de/ctdo/bunti/model/BuntiDMXDeviceTest.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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()); + } + }