]> git.basschouten.com Git - openhab-addons.git/blob
6701b62fe3bb753115a4c1d9e4275c7b06e43f26
[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.command;
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.command.SConfigCommand.ConfigCommandType;
20
21 /**
22  * Tests cases for {@link SConfigCommand}.
23  *
24  * @author Marcel Verpaalen - Initial contribution
25  */
26 @NonNullByDefault
27 public class SConfigCommandTest {
28
29     private static final String RF_TEST_ADDRESS = "0e15cc";
30     private static final int TEST_ROOM = 2;
31
32     @Test
33     public void setRoomTest() {
34         CubeCommand cubeCommand = new SConfigCommand(RF_TEST_ADDRESS, TEST_ROOM, ConfigCommandType.SetRoom);
35         String commandString = cubeCommand.getCommandString();
36         assertEquals("s:AAAiAAAADhXMAAI=\r\n", commandString);
37     }
38
39     @Test
40     public void removeRoomTest() {
41         CubeCommand cubeCommand = new SConfigCommand(RF_TEST_ADDRESS, 1, ConfigCommandType.RemoveRoom);
42         String commandString = cubeCommand.getCommandString();
43         assertEquals("s:AAAjAAAADhXMAAE=\r\n", commandString);
44     }
45 }