1a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao/*
2a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * Copyright (C) 2010 The Android Open Source Project
3a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao *
4a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * Licensed under the Apache License, Version 2.0 (the "License");
5a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * you may not use this file except in compliance with the License.
6a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * You may obtain a copy of the License at
7a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao *
8a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao *      http://www.apache.org/licenses/LICENSE-2.0
9a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao *
10a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * Unless required by applicable law or agreed to in writing, software
11a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * distributed under the License is distributed on an "AS IS" BASIS,
12a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * See the License for the specific language governing permissions and
14a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao * limitations under the License.
15a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao */
16a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao
17a58a8751b4c2ce457f0082a0baaee61312d56195Bai Taopackage android.location;
18a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao
19a58a8751b4c2ce457f0082a0baaee61312d56195Bai Taoimport android.test.AndroidTestCase;
20a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao
21a58a8751b4c2ce457f0082a0baaee61312d56195Bai Taopublic class CountryTester extends AndroidTestCase {
22a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao    public void testCountryEquals() {
23a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao        Country countryA = new Country("US", Country.COUNTRY_SOURCE_NETWORK);
24a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao        Country countryB = new Country("US", Country.COUNTRY_SOURCE_LOCALE);
25a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao        Country countryC = new Country("CN", Country.COUNTRY_SOURCE_LOCALE);
26a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao        Country countryD = new Country("us", Country.COUNTRY_SOURCE_NETWORK);
27a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao        assertTrue(countryA.equalsIgnoreSource(countryB));
28a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao        assertFalse(countryA.equalsIgnoreSource(countryC));
29a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao        assertFalse(countryA.equals(countryC));
30a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao        assertTrue(countryA.equals(countryD));
31a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao        assertTrue(countryA.hashCode() == countryD.hashCode());
32a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao    }
33a58a8751b4c2ce457f0082a0baaee61312d56195Bai Tao}
34