Esempio n. 1
0
 public void ValidateWithValidCountry()
 {
     string err = string.Empty;
     string modStr = string.Empty;
     Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType());
     Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml");
     AdifEnumerations aEnums = new AdifEnumerations(str);
     Country country = new Country("UNITED STATES", aEnums);
     Assert.IsTrue(country.Validate(out err, out modStr));
     Assert.IsNull(err);
     Assert.IsNull(modStr);
 }
Esempio n. 2
0
 public void ValidateWithInvalidCountry()
 {
     string err = string.Empty;
     string modStr = string.Empty;
     Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType());
     Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml");
     AdifEnumerations aEnums = new AdifEnumerations(str);
     Country country = new Country("COCHISE", aEnums);
     Assert.IsFalse(country.Validate(out err, out modStr));
     Assert.AreEqual("\t'COCHISE' is not a valid country", err);
     Assert.IsNull(modStr);
 }