2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.loxone.internal.controls;
15 import org.junit.jupiter.api.BeforeEach;
16 import org.junit.jupiter.api.Test;
17 import org.openhab.core.library.types.OnOffType;
20 * Test class for (@link LxControlUpDownDigital}
22 * @author Pawel Pieczul - initial contribution
25 public class LxControlUpDownDigitalTest extends LxControlTest {
32 downChannel = " / Down";
33 setupControl("0fd08ca6-01a6-d72a-ffff403fb0c34b9e", "0b734138-037d-034e-ffff403fb0c34b9e",
34 "0b734138-033e-02d4-ffff403fb0c34b9e", "First Floor Scene");
38 public void testControlCreation() {
39 testControlCreation(LxControlUpDownDigital.class, 1, 0, 2, 2, 0);
43 public void testChannels() {
44 testChannel("Switch", upChannel);
45 testChannel("Switch", downChannel);
49 public void testCommands() {
50 testChannelState(upChannel, OnOffType.OFF);
51 testChannelState(downChannel, OnOffType.OFF);
53 executeCommand(upChannel, OnOffType.ON);
55 testChannelState(upChannel, OnOffType.ON);
56 testChannelState(downChannel, OnOffType.OFF);
57 executeCommand(upChannel, OnOffType.OFF);
59 testChannelState(upChannel, OnOffType.OFF);
60 testChannelState(downChannel, OnOffType.OFF);
62 executeCommand(downChannel, OnOffType.ON);
64 testChannelState(upChannel, OnOffType.OFF);
65 testChannelState(downChannel, OnOffType.ON);
66 executeCommand(downChannel, OnOffType.OFF);
67 testAction("DownOff");
68 testChannelState(upChannel, OnOffType.OFF);
69 testChannelState(downChannel, OnOffType.OFF);
71 executeCommand(upChannel, OnOffType.ON);
73 testChannelState(upChannel, OnOffType.ON);
74 testChannelState(downChannel, OnOffType.OFF);
75 executeCommand(downChannel, OnOffType.ON);
77 testChannelState(upChannel, OnOffType.OFF);
78 testChannelState(downChannel, OnOffType.ON);
80 executeCommand(upChannel, OnOffType.ON);
82 testChannelState(upChannel, OnOffType.ON);
83 testChannelState(downChannel, OnOffType.OFF);
85 executeCommand(upChannel, OnOffType.OFF);
87 testChannelState(upChannel, OnOffType.OFF);
88 testChannelState(downChannel, OnOffType.OFF);
90 executeCommand(upChannel, OnOffType.OFF);
92 testChannelState(upChannel, OnOffType.OFF);
93 testChannelState(downChannel, OnOffType.OFF);
95 executeCommand(downChannel, OnOffType.OFF);
97 testChannelState(upChannel, OnOffType.OFF);
98 testChannelState(downChannel, OnOffType.OFF);