]> git.basschouten.com Git - openhab-addons.git/blob
2b8f41ffe866a48065ef8d10c0f597b2de24b525
[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.loxone.internal.controls;
14
15 import org.junit.jupiter.api.BeforeEach;
16 import org.junit.jupiter.api.Test;
17 import org.openhab.core.library.types.StringType;
18
19 /**
20  * Test class for (@link LxControlTextState}
21  *
22  * @author Pawel Pieczul - initial contribution
23  *
24  */
25 public class LxControlTextStateTest extends LxControlTest {
26     @BeforeEach
27     public void setup() {
28         setupControl("106bed36-016d-6dd8-ffffffe6109fb656", "0b734138-038c-0386-ffff403fb0c34b9e",
29                 "0fe665f4-0161-4773-ffff403fb0c34b9e", "Gate");
30     }
31
32     @Test
33     public void testControlCreation() {
34         testControlCreation(LxControlTextState.class, 1, 0, 1, 1, 1);
35     }
36
37     @Test
38     public void testChannels() {
39         testChannel("String", null, null, null, null, null, true, null);
40     }
41
42     @Test
43     public void testLoxoneStateChanges() {
44         String s = new String();
45         for (char c = ' '; c <= '~'; c++) {
46             changeLoxoneState("textandicon", s);
47             testChannelState(new StringType(s));
48             s = s + c;
49         }
50         s = s + "\n\tabc\ndef\n";
51         changeLoxoneState("textandicon", s);
52         testChannelState(new StringType(s));
53     }
54 }