]> git.basschouten.com Git - openhab-addons.git/blob
ff63759255ca2f2613c7f24fa7de482c82727023
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.mybmw.internal.util;
14
15 import static org.junit.jupiter.api.Assertions.assertTrue;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.junit.jupiter.api.Test;
19 import org.openhab.binding.mybmw.internal.utils.Converter;
20
21 /**
22  * The {@link LocaleTest} is testing locale settings
23  *
24  * @author Bernd Weymann - Initial contribution
25  */
26 @NonNullByDefault
27 @SuppressWarnings("null")
28 public class LocaleTest {
29
30     @Test
31     public void testDistance() {
32         double lat = 45.678;
33         double lon = 8.765;
34         double distance = 0.005;
35         double dist = Converter.measureDistance(lat, lon, lat + distance, lon + distance);
36         assertTrue(dist < 1, "Distance below 1 km");
37     }
38 }