public void ConvertTo() { var xml = string.Format( "<s0:Properties xmlns:s0=\"{0}\" xmlns:s1=\"urn\">" + "<s1:Property1 xpath=\"*/some-node\" />" + "<s1:Property2 mode=\"promote\" xpath=\"*/other-node\" />" + "</s0:Properties>", SchemaAnnotations.NAMESPACE); var sut = new PropertyExtractorCollectionConverter(); var extractorCollection = new PropertyExtractorCollection( new XPathExtractor(new XmlQualifiedName("Property1", "urn"), "*/some-node", ExtractionMode.Write), new XPathExtractor(new XmlQualifiedName("Property2", "urn"), "*/other-node", ExtractionMode.Promote)); Assert.That( sut.ConvertTo(extractorCollection, typeof(string)), Is.EqualTo(xml)); }
public void ConvertToNull() { var sut = new PropertyExtractorCollectionConverter(); Assert.That(sut.ConvertTo(new PropertyExtractorCollection(), typeof(string)), Is.Null); }