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.lcn.internal.subhandler;
15 import static org.mockito.ArgumentMatchers.any;
16 import static org.mockito.Mockito.verify;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.junit.jupiter.api.BeforeEach;
20 import org.junit.jupiter.api.Test;
21 import org.openhab.binding.lcn.internal.common.LcnChannelGroup;
22 import org.openhab.core.library.types.DecimalType;
27 * @author Fabian Wolter - Initial contribution
30 public class LcnModuleS0CounterSubHandlerTest extends AbstractTestLcnModuleSubHandler {
38 public void testZero() {
39 tryParseAllHandlers("=M000005.C10");
40 verify(handler).updateChannel(LcnChannelGroup.S0INPUT, "1", new DecimalType(0));
41 verify(handler).updateChannel(any(), any(), any());
45 public void testMaxValue() {
46 tryParseAllHandlers("=M000005.C14294967295");
47 verify(handler).updateChannel(LcnChannelGroup.S0INPUT, "1", new DecimalType(4294967295L));
48 verify(handler).updateChannel(any(), any(), any());
53 tryParseAllHandlers("=M000005.C412345");
54 verify(handler).updateChannel(LcnChannelGroup.S0INPUT, "4", new DecimalType(12345));
55 verify(handler).updateChannel(any(), any(), any());