Exemple #1
0
        public void ConvertToNull()
        {
            var sut = new XPathExtractorCollectionConverter();

            Assert.That(
                sut.ConvertTo(new XPathExtractorCollection(), typeof(string)),
                Is.Null);
        }
Exemple #2
0
        public void ConvertTo()
        {
            var xml = string.Format(
                "<s0:Properties xmlns:s0=\"{0}\" xmlns:s1=\"urn\">"
                + "<s1:Property1 xpath=\"*/some-node\" />"
                + "<s1:Property2 promoted=\"true\" xpath=\"*/other-node\" />"
                + "</s0:Properties>",
                SchemaAnnotations.NAMESPACE);

            var sut = new XPathExtractorCollectionConverter();
            var extractorCollection = sut.ConvertFrom(xml);

            // ReSharper disable AssignNullToNotNullAttribute
            Assert.That(
                sut.ConvertTo(extractorCollection, typeof(string)),
                Is.EqualTo(xml));
            // ReSharper restore AssignNullToNotNullAttribute
        }