public void LocationType_ArchivingLocation_ValidLocationType() { var locIn = new ArchivingLocation { Continent = "Asia", Country = "China", Region = "Great Wall", Address = "315 N Main St" }; var locOut = locIn.ToIMDILocationType(); Assert.AreEqual("Asia", locOut.Continent.Value); Assert.AreEqual("China", locOut.Country.Value); Assert.AreEqual("Great Wall", locOut.Region[0]); Assert.AreEqual("315 N Main St", locOut.Address); }
/// <summary>Copy information from ArchivingLocation object to Location_Type object</summary> /// <param name="archivingLocation"></param> /// <returns></returns> public static LocationType ToIMDILocationType(this ArchivingLocation archivingLocation) { var returnVal = new LocationType { Address = archivingLocation.Address }; returnVal.SetContinent(archivingLocation.Continent); returnVal.SetCountry(archivingLocation.Country); // region is an array if (!string.IsNullOrEmpty(archivingLocation.Region)) { returnVal.Region.Add(archivingLocation.Region); } return(returnVal); }