]> git.basschouten.com Git - openhab-addons.git/blob
3fdc9889a32e8ee6314327c17ebe1a3d4939bd1f
[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
14 package org.openhab.binding.nobohub.internal.model;
15
16 import static org.junit.jupiter.api.Assertions.assertEquals;
17 import static org.junit.jupiter.api.Assertions.assertTrue;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.junit.jupiter.api.Test;
21
22 /**
23  * Unit tests for Zone model object.
24  *
25  * @author Jørgen Austvik - Initial contribution
26  */
27 @NonNullByDefault
28 public class ZoneTest {
29
30     @Test
31     public void testParseH01Simple() throws NoboDataException {
32         Zone zone = Zone.fromH01("H01 1 1. etage 20 22 16 1 -1");
33         assertEquals(1, zone.getId());
34         assertEquals("1. etage", zone.getName());
35         assertEquals(20, zone.getActiveWeekProfileId());
36         assertTrue(zone.getAllowOverrides());
37         assertEquals(16, zone.getEcoTemperature());
38         assertEquals(22, zone.getComfortTemperature());
39     }
40
41     @Test
42     public void testGenerateCommand() throws NoboDataException {
43         Zone zone = Zone.fromH01("H01 1 1. etage 20 22 16 1 -1");
44         assertEquals("U00 1 1. etage 20 22 16 1 -1", zone.generateCommandString("U00"));
45     }
46 }