Example #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);
     My_Country country = new My_Country("UNITED STATES", aEnums);
     Assert.IsTrue(country.Validate(out err, out modStr));
     Assert.IsNull(err);
     Assert.IsNull(modStr);
 }
Example #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);
     My_Country country = new My_Country("COCHISE", aEnums);
     Assert.IsFalse(country.Validate(out err, out modStr));
     Assert.AreEqual("\t'COCHISE' is not a valid country", err);
     Assert.IsNull(modStr);
 }