use of net.solarnetwork.node.io.mbus.MBusSecondaryAddress in project solarnetwork-node by SolarNetwork.
the class MBusSecondaryAddressTests method isValid_valid.
@Test
public void isValid_valid() {
// GIVEN
MBusSecondaryAddress addr = new MBusSecondaryAddress("1234567890ABCDEF");
// THEN
assertThat("Invalid address", addr.isValid(), is(true));
}
use of net.solarnetwork.node.io.mbus.MBusSecondaryAddress in project solarnetwork-node by SolarNetwork.
the class MBusSecondaryAddressTests method equals_identity.
@Test
public void equals_identity() throws DecoderException {
// GIVEN
final byte[] data = decodeHex("1234567890ABCDEF");
MBusSecondaryAddress addr = new MBusSecondaryAddress(data);
// THEN
assertThat("Addresses equal for same byte array instance", addr.equals(new MBusSecondaryAddress(data)), is(true));
}
use of net.solarnetwork.node.io.mbus.MBusSecondaryAddress in project solarnetwork-node by SolarNetwork.
the class MBusSecondaryAddressTests method equals_content.
@Test
public void equals_content() throws DecoderException {
MBusSecondaryAddress addr = new MBusSecondaryAddress(decodeHex("1234567890ABCDEF"));
// THEN
assertThat("Addresses equal for same byte array instance", addr.equals(new MBusSecondaryAddress(decodeHex("1234567890ABCDEF"))), is(true));
}
use of net.solarnetwork.node.io.mbus.MBusSecondaryAddress in project solarnetwork-node by SolarNetwork.
the class MBusSecondaryAddressTests method notEquals.
@Test
public void notEquals() throws DecoderException {
MBusSecondaryAddress addr = new MBusSecondaryAddress(decodeHex("1234567890ABCDEF"));
// THEN
assertThat("Addresses equal for same byte array instance", addr.equals(new MBusSecondaryAddress(decodeHex("01234567890ABCDE"))), is(false));
}
use of net.solarnetwork.node.io.mbus.MBusSecondaryAddress in project solarnetwork-node by SolarNetwork.
the class MBusSecondaryAddressTests method isValid_invalid.
@Test
public void isValid_invalid() {
// GIVEN
MBusSecondaryAddress addr = new MBusSecondaryAddress("0000000000000000");
// THEN
assertThat("Invalid address", addr.isValid(), is(false));
}
Aggregations