]> git.basschouten.com Git - openhab-addons.git/blob
f319f4654ee7e24e688159692bb6448dd5b5f913
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.max.internal.message;
14
15 import static org.junit.jupiter.api.Assertions.*;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.junit.jupiter.api.Test;
19 import org.openhab.binding.max.internal.device.DeviceType;
20
21 /**
22  * Tests cases for {@link NMessage}.
23  *
24  * @author Marcel Verpaalen - Initial contribution
25  */
26 @NonNullByDefault
27 public class NMessageTest {
28
29     public static final String RAW_DATA = "N:Aw4VzExFUTAwMTUzNDD/";
30     // public final String rawData = "N:AQe250tFUTAxNDUxNzL/";
31
32     private NMessage message = new NMessage(RAW_DATA);
33
34     @Test
35     public void getMessageTypeTest() {
36         MessageType messageType = ((Message) message).getType();
37         assertEquals(MessageType.N, messageType);
38     }
39
40     @Test
41     public void getRFAddressTest() {
42         String rfAddress = message.getRfAddress();
43
44         assertEquals("0E15CC", rfAddress);
45     }
46
47     @Test
48     public void getSerialNumberTest() {
49         String serialNumber = message.getSerialNumber();
50
51         assertEquals("LEQ0015340", serialNumber);
52     }
53
54     @Test
55     public void getDeviceTypeTest() {
56         DeviceType deviceType = message.getDeviceType();
57
58         assertEquals(DeviceType.WallMountedThermostat, deviceType);
59     }
60 }