public void TestValidateValidCountryCode() { Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType()); Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml"); AdifEnumerations aEnums = new AdifEnumerations(str); DXCC dxcc = new DXCC("1", aEnums); string err = string.Empty; string modStr = string.Empty; Assert.IsTrue(dxcc.Validate(out err, out modStr)); Assert.IsNull(err); Assert.IsNull(modStr); }
public void TestValidateInvalidCountryCode() { Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType()); Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml"); AdifEnumerations aEnums = new AdifEnumerations(str); DXCC dxcc = new DXCC("1023", aEnums); string err = string.Empty; string modStr = string.Empty; Assert.IsFalse(dxcc.Validate(out err, out modStr)); Assert.AreEqual("\tThis QSO Field is of type enumeration. The value '1023' " + "was not found in enumeration.", err); Assert.IsNull(modStr); }