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.boschindego.internal;
15 import static org.hamcrest.CoreMatchers.*;
16 import static org.hamcrest.MatcherAssert.assertThat;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.junit.jupiter.api.Test;
20 import org.openhab.binding.boschindego.internal.dto.DeviceCommand;
23 * Unit tests for {@link DeviceStatus}.
25 * @author Jacob Laursen - Initial contribution
28 public class DeviceStatusTest {
30 public void unknownIdleStateHasReturnCommand() {
31 assertThat(DeviceStatus.fromCode(256).getAssociatedCommand(), is(DeviceCommand.RETURN));
35 public void unknownMowStateHasReturnCommand() {
36 assertThat(DeviceStatus.fromCode(520).getAssociatedCommand(), is(DeviceCommand.MOW));
40 public void unknownReturnStateHasReturnCommand() {
41 assertThat(DeviceStatus.fromCode(777).getAssociatedCommand(), is(DeviceCommand.RETURN));
45 public void chargingIsCharging() {
46 assertThat(DeviceStatus.fromCode(257).isCharging(), is(true));
50 public void dockedLoadingMapIsActive() {
51 assertThat(DeviceStatus.fromCode(262).isActive(), is(true));
55 public void lawnCompleteIsCompleted() {
56 assertThat(DeviceStatus.fromCode(775).isCompleted(), is(true));