]> git.basschouten.com Git - openhab-addons.git/blob
15e135e2c38a6b4f32604d4ff3bc25ce5c29531c
[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.energidataservice.internal.api;
14
15 import static org.hamcrest.MatcherAssert.assertThat;
16 import static org.hamcrest.Matchers.is;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.junit.jupiter.api.Test;
20 import org.junit.jupiter.api.extension.ExtendWith;
21 import org.mockito.junit.jupiter.MockitoExtension;
22
23 /**
24  * Tests for {@link GlobalLocationNumber}.
25  * 
26  * @author Jacob Laursen - Initial contribution
27  */
28 @NonNullByDefault
29 @ExtendWith(MockitoExtension.class)
30 public class GlobalLocationNumberTest {
31
32     @Test
33     void isValid() {
34         assertThat(GlobalLocationNumber.of("5790000682102").isValid(), is(true));
35     }
36
37     @Test
38     void isInvalid() {
39         assertThat(GlobalLocationNumber.of("5790000682103").isValid(), is(false));
40     }
41
42     @Test
43     void emptyIsInvalid() {
44         assertThat(GlobalLocationNumber.EMPTY.isValid(), is(false));
45     }
46 }