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