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.vdr.internal;
15 import static org.junit.jupiter.api.Assertions.assertEquals;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.junit.jupiter.api.Test;
19 import org.openhab.binding.vdr.internal.svdrp.SVDRPException;
20 import org.openhab.binding.vdr.internal.svdrp.SVDRPTimerList;
23 * Specific unit tests to check if {@link SVDRPTimerList} parses SVDRP responses correctly
25 * @author Matthias Klocke - Initial contribution
29 public class SVDRPTimerListTest {
30 private final String timerListResponseTimerActive = """
31 1 1:1:2021-01-12:2013:2110:50:99:Charité (1/6)~Eiserne Lunge:Test
32 2 9:1:2021-01-12:2058:2200:50:99:Charité (2/6)~Blutsauger:Test\
34 private final String timerListResponseTimerNotActive = """
35 1 1:1:2021-01-12:2013:2110:50:99:Charité (1/6)~Eiserne Lunge:Test
36 2 1:1:2021-01-12:2058:2200:50:99:Charité (2/6)~Blutsauger:Test\
40 public void testParseTimerList() throws SVDRPException {
41 SVDRPTimerList list = SVDRPTimerList.parse(timerListResponseTimerActive);
42 assertEquals(true, list.isRecordingActive());
43 list = SVDRPTimerList.parse(timerListResponseTimerNotActive);
44 assertEquals(false, list.isRecordingActive());