Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
t-8ch committed Dec 23, 2018
1 parent 387ede2 commit ac88934
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void setup() {
}

@Test
public void converterInitializationBindsToCorrectCluster() {
public void converterInitializationForCommandBindsToCorrectCluster() {
channelProperties.put("zigbee_shortpress_cluster_id", "0x0008");
channelProperties.put("zigbee_shortpress_command_id", "0x0017");

Expand All @@ -74,6 +74,20 @@ public void converterInitializationBindsToCorrectCluster() {
verify(cluster, times(1)).addCommandListener(converter);
}

@Test
public void converterInitializationForAttributeBindsToCorrectCluster() {
channelProperties.put("zigbee_shortpress_cluster_id", "0x0008");
channelProperties.put("zigbee_shortpress_attribute_id", "0x0017");
channelProperties.put("zigbee_shortpress_attribute_value", "2");

ZclCluster cluster = mockCluster(8);

boolean initResult = converter.initializeConverter();

assertTrue(initResult);
verify(cluster, times(1)).addAttributeListener(converter);
}

@Test
public void converterInitializationBindsToClusterOnlyOnce() {
channelProperties.put("zigbee_shortpress_cluster_id", "0x0008");
Expand Down Expand Up @@ -103,7 +117,7 @@ public void converterInitializationClusterIdIsMandatory() {
}

@Test
public void converterInitializationCommandIdIsMandatory() {
public void converterInitializationCommandIdOrAttributeIsMandatory() {
channelProperties.put("zigbee_shortpress_cluster_id", "0x008");
mockCluster(8);
boolean initResult = converter.initializeConverter();
Expand Down

0 comments on commit ac88934

Please sign in to comment.