示例#1
0
 public void TestValidate()
 {
     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);
     Cont cont = new Cont("AF", aEnums);
     Assert.IsTrue(cont.Validate(out err, out modStr));
     Assert.IsNull(err);
     Assert.IsNull(modStr);
 }
示例#2
0
 public void TestValidateInvalidValue()
 {
     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);
     Cont cont = new Cont("AX", aEnums);
     Assert.IsFalse(cont.Validate(out err, out modStr));
     Assert.AreEqual("\tThis QSO Field is of type enumeration. The value 'AX' " +
                     "was not found in enumeration.", err);
     Assert.IsNull(modStr);
 }