public void TestValidateValidValue() { Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType()); Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml"); AdifEnumerations aEnums = new AdifEnumerations(str); Qso_Complete qc = new Qso_Complete("?", aEnums); string err = string.Empty; string modStr = string.Empty; Assert.IsTrue(qc.Validate(out err, out modStr)); Assert.IsNull(err); Assert.IsNull(modStr); }
public void TestValidateInvalidValue() { Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType()); Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml"); AdifEnumerations aEnums = new AdifEnumerations(str); Qso_Complete qc = new Qso_Complete("F", aEnums); string err = string.Empty; string modStr = string.Empty; Assert.IsFalse(qc.Validate(out err, out modStr)); Assert.AreEqual("\tThis QSO Field is of type enumeration. The value 'F' was not found in enumeration.", err); Assert.IsNull(modStr); }