updated tests and split some tests
This commit is contained in:
parent
43543682f9
commit
8cd211e6d9
|
@ -88,19 +88,28 @@ public class BuntiDMXDeviceTest {
|
||||||
assertEquals(dut.getChannelValueByName("nonexistent"),0 );
|
assertEquals(dut.getChannelValueByName("nonexistent"),0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
private Map<String, Object> createOptions() {
|
||||||
public void testGetChannelData() throws Exception {
|
|
||||||
Map<String, Object> options = new HashMap<String, Object>();
|
Map<String, Object> options = new HashMap<String, Object>();
|
||||||
options.put("blue", 99);
|
options.put("blue", 99);
|
||||||
options.put("red", 66);
|
options.put("red", 66);
|
||||||
options.put("green", 77);
|
options.put("green", 77);
|
||||||
options.put("speed", 111);
|
options.put("speed", 111);
|
||||||
options.put("mode", 222);
|
options.put("mode", 222);
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
assertTrue(dut.setValuesFromOptions(options));
|
@Test
|
||||||
|
public void testGetChannelDataCount() throws Exception {
|
||||||
|
dut.setValuesFromOptions(createOptions());
|
||||||
Map<Integer,Integer> channelData = dut.getChannelData();
|
Map<Integer,Integer> channelData = dut.getChannelData();
|
||||||
assertEquals(channelData.size(), 5);
|
assertEquals(channelData.size(), 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGetChannelDataOrder() throws Exception {
|
||||||
|
dut.setValuesFromOptions(createOptions());
|
||||||
|
|
||||||
|
Map<Integer,Integer> channelData = dut.getChannelData();
|
||||||
|
|
||||||
assertEquals(new Integer(222), channelData.get(STARTADDRESS + 0 + DMX.DMX_STARTADDRESS_OFFSET));
|
assertEquals(new Integer(222), channelData.get(STARTADDRESS + 0 + DMX.DMX_STARTADDRESS_OFFSET));
|
||||||
assertEquals(new Integer(66), channelData.get(STARTADDRESS + 1 + 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());
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue