Пример #1
0
 public void TestValidateValidValue()
 {
     Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType());
     Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml");
     AdifEnumerations aEnums = new AdifEnumerations(str);
     string err = string.Empty;
     string modStr = string.Empty;
     Qsl_Sent rcvd = new Qsl_Sent("Y", aEnums);
     Assert.IsTrue(rcvd.Validate(out err, out modStr));
     Assert.IsNull(err);
     Assert.IsNull(modStr);
 }
Пример #2
0
 public void TestValidateInvalidValue()
 {
     Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType());
     Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml");
     AdifEnumerations aEnums = new AdifEnumerations(str);
     string err = string.Empty;
     string modStr = string.Empty;
     Qsl_Sent rcvd = new Qsl_Sent("F", aEnums);
     Assert.IsFalse(rcvd.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);
 }