public void GetReaderAtContent_ObjectWithXmlObjectSerializer_ReturnsExpected() { var extensionObject = new ExtensionObject() { Value = 10 }; var content = new XmlSyndicationContent("type", extensionObject, new DataContractSerializer(typeof(ExtensionObject))); using (XmlReader reader = content.GetReaderAtContent()) { CompareHelper.AssertEqualLongString(@"<content type=""type"" xmlns=""http://www.w3.org/2005/Atom""><XmlSyndicationContentTests.ExtensionObject xmlns=""http://schemas.datacontract.org/2004/07/System.ServiceModel.Syndication.Tests"" xmlns:i=""http://www.w3.org/2001/XMLSchema-instance""><Value>10</Value></XmlSyndicationContentTests.ExtensionObject></content>", reader.ReadOuterXml()); } }
public void GetReaderAtContent_ObjectWithXmlSerializer_ReturnsExpected() { var extensionObject = new ExtensionObject() { Value = 10 }; var content = new XmlSyndicationContent("type", extensionObject, new XmlSerializer(typeof(ExtensionObject))); using (XmlReader reader = content.GetReaderAtContent()) { CompareHelper.AssertEqualLongString(@"<content type=""type"" xmlns=""http://www.w3.org/2005/Atom""><ExtensionObject xmlns="""" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""><Value>10</Value></ExtensionObject></content>", reader.ReadOuterXml()); } }
public void GetReaderAtContent_WithReader_ReturnsExpected() { var content = new XmlSyndicationContent( new XElement("ParentObject", new XElement("ExtensionObject", new XElement("Value", 10) ) ).CreateReader() ); XmlReader reader = content.GetReaderAtContent(); CompareHelper.AssertEqualLongString(@"<ParentObject><ExtensionObject><Value>10</Value></ExtensionObject></ParentObject>", reader.ReadOuterXml()); }