<commit_before>/*
 * Copyright (c) 2015 NECTEC
 *   National Electronics and Computer Technology Center, Thailand
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package th.or.nectec.tanrabad.entity;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;


public class LocationTest {
    private final double latitude1 = 14.078606;
    private final double longitude1 = 100.603120;
    private final Location location1 = new Location(latitude1, longitude1);

    @Test
    public void testGetLatitude()  {
        assertEquals(14.078606, location1.getLatitude(), 0.0001);
    }

    @Test
    public void testGetLongitude()  {
        assertEquals(100.603120, location1.getLongitude(), 0.0001);
    }

    @Test
    public void locationWithDifferentLatitudeMustNotEquals()  {
        Location location2 = new Location(15.078606, longitude1);
        assertNotEquals(location1, location2);
    }

    @Test
    public void locationWithDifferentLongitudeMustNotEquals()  {
        Location location2 = new Location(latitude1, 200.603120);
        assertNotEquals(location1, location2);
    }

    @Test
    public void locationTheSameLatitudeLongitudeMustEquals()  {
        Location location2 = new Location(latitude1, longitude1);
        assertEquals(location1, location2);
    }}<commit_msg>Refactor LocationTest<commit_after>/*
 * Copyright (c) 2015 NECTEC
 *   National Electronics and Computer Technology Center, Thailand
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package th.or.nectec.tanrabad.entity;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;


public class LocationTest {
    public static final double DELTA = 0.0001;

    private final double latitude1 = 14.078606;
    private final double longitude1 = 100.603120;
    private final Location location = new Location(latitude1, longitude1);

    @Test
    public void testGetLatitude()  {
        assertEquals(latitude1, location.getLatitude(), DELTA);
    }

    @Test
    public void testGetLongitude()  {
        assertEquals(longitude1, location.getLongitude(), DELTA);
    }

    @Test
    public void locationWithDifferentLatitudeMustNotEquals()  {
        Location anotherLocation = new Location(15.078606, longitude1);

        assertNotEquals(location, anotherLocation);
    }

    @Test
    public void locationWithDifferentLongitudeMustNotEquals()  {
        Location anotherLocation = new Location(latitude1, 200.603120);

        assertNotEquals(location, anotherLocation);
    }

    @Test
    public void locationTheSameLatitudeLongitudeMustEquals()  {
        Location sameLocation = new Location(latitude1, longitude1);

        assertEquals(location, sameLocation);
    }}
{'fraction_non_alphanumeric': 0.07873397855087627, 'fraction_numerical': 0.03818990321736856, 'mean_word_length': 3.6407766990291264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1792879', 'n_tokens_mistral': 1113, 'n_tokens_neox': 992, 'n_words': 341}