Home | History | Annotate | Download | only in dialpad
      1 /*
      2  * Copyright (C) 2013 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.dialer.dialpad;
     18 
     19 import android.test.suitebuilder.annotation.SmallTest;
     20 
     21 import junit.framework.TestCase;
     22 
     23 @SmallTest
     24 public class SmartDialCacheTest extends TestCase {
     25     public void testIsCountryNanp_CaseInsensitive() {
     26         assertFalse(SmartDialCache.isCountryNanp(null));
     27         assertFalse(SmartDialCache.isCountryNanp("CN"));
     28         assertFalse(SmartDialCache.isCountryNanp("HK"));
     29         assertFalse(SmartDialCache.isCountryNanp("uk"));
     30         assertFalse(SmartDialCache.isCountryNanp("sg"));
     31         assertTrue(SmartDialCache.isCountryNanp("US"));
     32         assertTrue(SmartDialCache.isCountryNanp("CA"));
     33         assertTrue(SmartDialCache.isCountryNanp("AS"));
     34         assertTrue(SmartDialCache.isCountryNanp("AI"));
     35         assertTrue(SmartDialCache.isCountryNanp("AG"));
     36         assertTrue(SmartDialCache.isCountryNanp("BS"));
     37         assertTrue(SmartDialCache.isCountryNanp("BB"));
     38         assertTrue(SmartDialCache.isCountryNanp("bm"));
     39         assertTrue(SmartDialCache.isCountryNanp("vg"));
     40         assertTrue(SmartDialCache.isCountryNanp("ky"));
     41         assertTrue(SmartDialCache.isCountryNanp("dm"));
     42         assertTrue(SmartDialCache.isCountryNanp("do"));
     43         assertTrue(SmartDialCache.isCountryNanp("gd"));
     44         assertTrue(SmartDialCache.isCountryNanp("gu"));
     45         assertTrue(SmartDialCache.isCountryNanp("jm"));
     46         assertTrue(SmartDialCache.isCountryNanp("pr"));
     47         assertTrue(SmartDialCache.isCountryNanp("ms"));
     48         assertTrue(SmartDialCache.isCountryNanp("mp"));
     49         assertTrue(SmartDialCache.isCountryNanp("kn"));
     50         assertTrue(SmartDialCache.isCountryNanp("lc"));
     51         assertTrue(SmartDialCache.isCountryNanp("vc"));
     52         assertTrue(SmartDialCache.isCountryNanp("tt"));
     53         assertTrue(SmartDialCache.isCountryNanp("tc"));
     54         assertTrue(SmartDialCache.isCountryNanp("vi"));
     55     }
     56 }
     57