Exemple #1
0
 public void TestTValidateValidMode()
 {
     Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType());
     Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml");
     AdifEnumerations aEnums = new AdifEnumerations(str);
     Prop_Mode pm = new Prop_Mode("EME", aEnums);
     string err = string.Empty;
     string modStr = string.Empty;
     Assert.IsTrue(pm.Validate(out err, out modStr));
     Assert.IsNull(err);
     Assert.IsNull(modStr);
 }
Exemple #2
0
 public void TestTValidateInvalidMode()
 {
     Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType());
     Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml");
     AdifEnumerations aEnums = new AdifEnumerations(str);
     Prop_Mode pm = new Prop_Mode("PMS", aEnums);
     string err = string.Empty;
     string modStr = string.Empty;
     Assert.IsFalse(pm.Validate(out err, out modStr));
     Assert.AreEqual("\tThis QSO Field is of type enumeration. The value 'PMS' was not found in enumeration.",
                     err);
     Assert.IsNull(modStr);
 }