Exemplo n.º 1
0
            public static StringCollectionSection FromString(string rawXml)
            {
                using var MyStream = new StringReader(rawXml);
                using var MyReader = XmlReader.Create(MyStream);

                MyReader.Read();

                var MySection = new StringCollectionSection();

                MySection.DeserializeSection(MyReader);

                return(MySection);
            }
Exemplo n.º 2
0
        public void ReadStringCollectionOne()
        {
            var RawXML = @"
<Test>
	<Text>
		<add>One</add>
	</Text>
</Test>";

            var MySection = StringCollectionSection.FromString(RawXML);

            CollectionAssert.AreEquivalent(new string[] { "One" }, MySection.Text.Select(element => element.Content));
        }