/*
 *  Copyright (C) 2016  Datamatica (dev@datamatica.pl)
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published
 *  by the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

package pl.datamatica.traccar.model;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

/**
 *
 * @author Jan Usarek
 */
public class PositionTest {

    @Test
    public void testNullValidStatus() throws Exception {
        Position position = new Position();
        assertTrue(position.hasProperValidStatus());
    }

    @Test
    public void testProperValidStatus() throws Exception {
        Position position = new Position();
        position.setValidStatus(Position.VALID_STATUS_CORRECT_POSITION);
        assertTrue(position.hasProperValidStatus());
    }

    @Test
    public void testAlarmValidStatus() throws Exception {
        Position position = new Position();
        position.setValidStatus(Position.VALID_STATUS_ALARM);
        assertFalse(position.hasProperValidStatus());
    }

}

@@ -860,16 +860,61 @@
 rtTrue;%0A
+import static org.junit.Assert.assertEquals;%0A
 import o
@@ -1641,12 +1641,239 @@
 );%0A    %7D
+%0A    %0A    @Test%0A    public void testSpeedUnitConversion() throws Exception %7B%0A        Position position = new Position();%0A        position.setSpeed(1000.00);%0A        assertEquals(1852, position.getSpeedInKmh().intValue());%0A    %7D
 %0A%0A%7D%0A

Add speed conversion unit test.