public static CustomCollectionSection FromString(string rawXml) { using var MyStream = new StringReader(rawXml); using var MyReader = XmlReader.Create(MyStream); MyReader.Read(); var MySection = new CustomCollectionSection(); MySection.DeserializeSection(MyReader); return(MySection); }
public void ReadCustomCollectionThree() { var RawXML = @" <Test> <Text> <add>1</add> <add>2</add> <add>3</add> </Text> </Test>"; var MySection = CustomCollectionSection.FromString(RawXML); CollectionAssert.AreEquivalent(new int[] { 1, 2, 3 }, MySection.Text.Select(element => element.Content)); }