]> git.basschouten.com Git - openhab-addons.git/blob
8fa8ca68808c6767882ef77834828bc4815791a2
[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.lcn.internal.subhandler;
14
15 import static org.mockito.Mockito.verify;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.junit.jupiter.api.BeforeEach;
19 import org.junit.jupiter.api.Test;
20 import org.openhab.binding.lcn.internal.common.LcnException;
21 import org.openhab.core.library.types.StringType;
22
23 /**
24  * Test class.
25  *
26  * @author Fabian Wolter - Initial contribution
27  */
28 @NonNullByDefault
29 public class LcnModuleRvarModeSubHandlerTest extends AbstractTestLcnModuleSubHandler {
30     private @NonNullByDefault({}) LcnModuleRvarModeSubHandler l;
31
32     @Override
33     @BeforeEach
34     public void setUp() {
35         super.setUp();
36
37         l = new LcnModuleRvarModeSubHandler(handler, info);
38     }
39
40     @Test
41     public void testhandleCommand1Cooling() throws LcnException {
42         l.handleCommandString(new StringType("COOLING"), 0);
43         verify(handler).sendPck("REATC");
44     }
45
46     @Test
47     public void testhandleCommand1Heating() throws LcnException {
48         l.handleCommandString(new StringType("HEATING"), 0);
49         verify(handler).sendPck("REATH");
50     }
51
52     @Test
53     public void testhandleCommand2Cooling() throws LcnException {
54         l.handleCommandString(new StringType("COOLING"), 1);
55         verify(handler).sendPck("REBTC");
56     }
57
58     @Test
59     public void testhandleCommand2Heating() throws LcnException {
60         l.handleCommandString(new StringType("HEATING"), 1);
61         verify(handler).sendPck("REBTH");
62     }
63 }