]> git.basschouten.com Git - openhab-addons.git/blob
77e01bcf7d6b367316ed765e28da3ee3e2fc9f79
[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 package org.openhab.binding.lametrictime.internal.api.dto.enums;
14
15 import static org.junit.jupiter.api.Assertions.*;
16
17 import org.junit.jupiter.api.Test;
18
19 /**
20  * ip mode test.
21  *
22  * @author Gregory Moyer - Initial contribution
23  */
24 public class IpModeTest {
25     @Test
26     public void testConversion() {
27         for (IpMode value : IpMode.values()) {
28             assertEquals(value, IpMode.toEnum(value.toRaw()));
29         }
30     }
31
32     @Test
33     public void testInvalidRawValue() {
34         assertNull(IpMode.toEnum("invalid raw value"));
35     }
36
37     @Test
38     public void testNullRawValue() {
39         assertNull(IpMode.toEnum(null));
40     }
41 }