public void TestToAdifString2()
 {
     Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType());
     Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml");
     AdifEnumerations aEnums = new AdifEnumerations(str);
     StringEnumerationValue se = new StringEnumerationValue("e6", "Contest_ID", aEnums);
     Assert.AreEqual("<StringEnumerationValue:2>e6", se.ToAdifString());
 }
 public void TestIsInEnumerationTrue()
 {
     string err = string.Empty;
     Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType());
     Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml");
     AdifEnumerations aEnums = new AdifEnumerations(str);
     StringEnumerationValue se = new StringEnumerationValue("RAC-CANADA-DAY", "Contest_ID", aEnums);
     Assert.IsTrue(se.IsInEnumeration(out err));
     Assert.AreEqual(null, err);
 }
 public void TestIsInEnumerationFalse()
 {
     string err = string.Empty;
     Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType());
     Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml");
     AdifEnumerations aEnums = new AdifEnumerations(str);
     StringEnumerationValue se = new StringEnumerationValue("e4", "Contest_ID", aEnums);
     Assert.IsFalse(se.IsInEnumeration(out err));
     Assert.AreEqual("\tThis QSO Field is of type enumeration. The value 'e4' " +
                         "was not found in enumeration.", err);
 }
 public void TestValidateValueInEnumeration()
 {
     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);
     StringEnumerationValue se = new StringEnumerationValue("RAC-CANADA-DAY", "Contest_ID", aEnums);
     Assert.IsTrue(se.Validate(out err,out modStr));
     Assert.IsNull(err);
     Assert.IsNull(modStr);
 }
 public void TestToAdifString()
 {
     string[] enums = {"e1", "e2", "e3", "e4"};
     StringEnumerationValue se = new StringEnumerationValue("e1", enums);
     Assert.AreEqual("<StringEnumerationValue:2>e1", se.ToAdifString());
 }