示例#1
0
 public void TestGetCountryNameValidCountryCode()
 {
     Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType());
     Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml");
     AdifEnumerations aEnums = new AdifEnumerations(str);
     DXCC dxcc = new DXCC("1", aEnums);
     string err = string.Empty;
     Assert.AreEqual("CANADA", dxcc.GetCountryName(out err));
     Assert.AreEqual(null, err);
 }
示例#2
0
 public void TestGetCountryNameInvalidCountryCode()
 {
     Assembly assembly = Assembly.GetAssembly((new AdifField()).GetType());
     Stream str = assembly.GetManifestResourceStream("hamqsler.AdifEnumerations.xml");
     AdifEnumerations aEnums = new AdifEnumerations(str);
     DXCC dxcc = new DXCC("1023", aEnums);
     string err = string.Empty;
     Assert.AreEqual(null, dxcc.GetCountryName(out err));
     Assert.AreEqual("\tCountry code '1023' is not a valid code. Country name cannot be retrieved.",
                     err);
 }