Exemple #1
0
        public void GetCountryCodeByPartialCode()
        {
            string result = CountryUtils.GetCountryCodeByCountry("USA");

            Assert.IsNotNull(result);
            Assert.AreEqual("US", result);
        }
Exemple #2
0
        public void GetCountryCodeFromPartial()
        {
            string result = CountryUtils.GetCountryCodeByCountry("Republic of Congo");

            Assert.IsNotNull(result);
            Assert.AreEqual("CD", result);
        }
Exemple #3
0
        public void GetCountryCodeByExactCode()
        {
            string result = CountryUtils.GetCountryCodeByCountry("IE");

            Assert.IsNotNull(result);
            Assert.AreEqual("IE", result);
        }
        public void CovertFromNumericToAlpha2()
        {
            string result = CountryUtils.GetCountryCodeByCountry("826", CountryCodeFormat.Alpha2);

            Assert.IsNotNull(result);
            Assert.AreEqual("GB", result);
        }
Exemple #5
0
        public void GetCountryCodeMisspelled()
        {
            string result = CountryUtils.GetCountryCodeByCountry("Afganistan");

            Assert.IsNotNull(result);
            Assert.AreEqual("AF", result);
        }
        public void CovertFromAlpha2ToAlpha3()
        {
            string result = CountryUtils.GetCountryCodeByCountry("GB", CountryCodeFormat.Alpha3);

            Assert.IsNotNull(result);
            Assert.AreEqual("GBR", result);
        }
        public void CovertFromAlpha3ToNumeric()
        {
            string result = CountryUtils.GetCountryCodeByCountry("GBR", CountryCodeFormat.Numeric);

            Assert.IsNotNull(result);
            Assert.AreEqual("826", result);
        }
        public void CovertFromCountryNametoAlpha2()
        {
            string result = CountryUtils.GetCountryCodeByCountry("United Kingdom of Great Britain and Northern Ireland", CountryCodeFormat.Alpha2);

            Assert.IsNotNull(result);
            Assert.AreEqual("GB", result);
        }
        public void GetCountryCodeAlpha3WithMisspelled()
        {
            string result = CountryUtils.GetCountryCodeByCountry("Afganistan", CountryCodeFormat.Alpha3);

            Assert.IsNotNull(result);
            Assert.AreEqual("AFG", result);
        }
        public void GetNetherlandsAntillesCountryCodeByCountryName()
        {
            string result = CountryUtils.GetCountryCodeByCountry("Netherlands Antilles");

            Assert.IsNotNull(result);
            Assert.AreEqual("AN", result);
        }
        public void GetCountryCodeByExactNumericCodeAndCountryCodeFormat()
        {
            string result = CountryUtils.GetCountryCodeByCountry("364", CountryCodeFormat.Numeric);

            Assert.IsNotNull(result);
            Assert.AreEqual("364", result);
        }
        public void GetCountryCodeAlpha3FromPartial()
        {
            string result = CountryUtils.GetCountryCodeByCountry("Republic of Congo", CountryCodeFormat.Alpha3);

            Assert.IsNotNull(result);
            Assert.AreEqual("COD", result);
        }
Exemple #13
0
        public void GetCountryCodeFakeCountry3()
        {
            string result = CountryUtils.GetCountryCodeByCountry("MyRussia");

            Assert.IsNull(result);
        }
Exemple #14
0
        public void GetCountryCodeFakeCountry2()
        {
            string result = CountryUtils.GetCountryCodeByCountry("Fakeistan");

            Assert.IsNull(result);
        }
Exemple #15
0
 public void GetCountryCodeNullDoesNotError()
 {
     CountryUtils.GetCountryCodeByCountry(null);
 }