2 * Copyright (c) 2010-2021 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.lcn.internal.subhandler;
15 import static org.mockito.Mockito.verify;
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.LcnChannelGroup;
21 import org.openhab.core.library.types.DecimalType;
26 * @author Fabian Wolter - Initial contribution
29 public class LcnModuleS0CounterSubHandlerTest extends AbstractTestLcnModuleSubHandler {
30 private @NonNullByDefault({}) LcnModuleS0CounterSubHandler l;
37 l = new LcnModuleS0CounterSubHandler(handler, info);
41 public void testZero() {
42 l.tryParse("=M000005.C10");
43 verify(handler).updateChannel(LcnChannelGroup.S0INPUT, "1", new DecimalType(0));
47 public void testMaxValue() {
48 l.tryParse("=M000005.C14294967295");
49 verify(handler).updateChannel(LcnChannelGroup.S0INPUT, "1", new DecimalType(4294967295L));
54 l.tryParse("=M000005.C412345");
55 verify(handler).updateChannel(LcnChannelGroup.S0INPUT, "4", new DecimalType(12345));