public void GetCountryTwoDifferentObjectsShouldHaveDifferentHashcode()
        {
            CountryCodeEntry entry1 = CountryCode.GetCountryCode("CZ");
            CountryCodeEntry entry2 = CountryCode.GetCountryCode("DE");

            Assert.AreNotEqual(entry1.GetHashCode(), entry2.GetHashCode());
        }
        public void GetCountryEqualsOnTwoDifferentObjectsShouldReturnFalse()
        {
            CountryCodeEntry entry1 = CountryCode.GetCountryCode("CZ");
            CountryCodeEntry entry2 = CountryCode.GetCountryCode("DE");

            Assert.IsFalse(entry1.Equals(entry2));
        }
        public void GetCountryAndChangeShouldNotChangeOtherCountries()
        {
            string           oldName;
            CountryCodeEntry entry = CountryCode.GetCountryCode("CY");

            Assert.IsNotNull(entry);
            oldName           = entry.CountryName;
            entry.CountryName = "Change to this";
            CountryCodeEntry newEntry = CountryCode.GetCountryCode("CY");

            Assert.IsNotNull(newEntry);
            Assert.AreEqual(oldName, newEntry.CountryName);
        }
        public void GetCountryCodeWithCZAplha2ShouldReturnCZEAsAplha3()
        {
            CountryCodeEntry entry = CountryCode.GetCountryCode("CZ");

            Assert.AreEqual("CZE", entry.Alpha3);
        }
        public void GetCountryCodeWithCZECodeShouldReturnCzechRepublic()
        {
            CountryCodeEntry entry = CountryCode.GetCountryCode("CZE");

            Assert.IsTrue(entry.CountryName.Contains("Czech Republic"));
        }
        public void GetCountryCodeWithWrongAlpha3CodeShouldReturnNull()
        {
            CountryCodeEntry entry = CountryCode.GetCountryCode("XXX");

            Assert.IsNull(entry);
        }
        public void GetCountryCodeWith4LetterCodeShouldReturnNullObject()
        {
            CountryCodeEntry entry = CountryCode.GetCountryCode("XXXX");

            Assert.IsNull(entry);
        }
        public void GetCountryCodeWithEmptyStringShouldReturnNullObject()
        {
            CountryCodeEntry entry = CountryCode.GetCountryCode(string.Empty);

            Assert.IsNull(entry);
        }
        public void GetCountryEqualsOnDifferentObjectShouldReturnFalse()
        {
            CountryCodeEntry entry = CountryCode.GetCountryCode("CZ");

            Assert.IsFalse(entry.Equals("Test"));
        }
Exemple #10
0
        public void IbanCountrySupportCheckWithNullShouldReturnFalse()
        {
            CountryCodeEntry entry = null;

            Assert.IsFalse(IbanUtils.IsSupportedCountry(entry));
        }