]> git.basschouten.com Git - openhab-addons.git/blob
c5742824548bd321be6ae37bc024eb11882a939c
[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  * priority test.
21  *
22  * @author Gregory Moyer - Initial contribution
23  */
24 public class PriorityTest {
25     @Test
26     public void testConversion() {
27         for (Priority value : Priority.values()) {
28             assertEquals(value, Priority.toEnum(value.toRaw()));
29         }
30     }
31
32     @Test
33     public void testInvalidRawValue() {
34         assertNull(Priority.toEnum("invalid raw value"));
35     }
36
37     @Test
38     public void testNullRawValue() {
39         assertNull(Priority.toEnum(null));
40     }
41 }