Ejemplo n.º 1
0
        public void ConvertFromNull()
        {
            var sut = new PropertyExtractorCollectionConverter();

            sut.ConvertFrom(null)
            .Should().BeOfType <PropertyExtractorCollection.EmptyPropertyExtractorCollection>()
            .Which.Should().BeEmpty();
        }
Ejemplo n.º 2
0
        public void ConvertFrom()
        {
            var xml = $@"<san:Properties xmlns:s0='urn' xmlns:san='{SchemaAnnotation.NAMESPACE}'>
  <s0:Property1 xpath='*/some-node'/>
  <s0:Property2 promoted='true' xpath='*/other-node'/>
</san:Properties>";

            var sut = new PropertyExtractorCollectionConverter();

            sut.ConvertFrom(xml)
            .Should().BeOfType <PropertyExtractorCollection>()
            .Which.Should().BeEquivalentTo(
                new XPathExtractor(new XmlQualifiedName("Property1", "urn"), "*/some-node", ExtractionMode.Write),
                new XPathExtractor(new XmlQualifiedName("Property2", "urn"), "*/other-node", ExtractionMode.Promote)
                );
        }