diff --git a/src/X.Web.RSS/RssDocument.cs b/src/X.Web.RSS/RssDocument.cs index a1ee946..fa5c6ea 100644 --- a/src/X.Web.RSS/RssDocument.cs +++ b/src/X.Web.RSS/RssDocument.cs @@ -114,14 +114,15 @@ public string ToXml() } public static RssDocument Load(Stream source) - { + { var xsn = new XmlSerializerNamespaces(); xsn.Add("atom", "http://www.w3.org/2005/Atom"); xsn.Add("dc", "http://purl.org/dc/elements/1.1/"); xsn.Add("content", "http://purl.org/rss/1.0/modules/content/"); - var ser = new XmlSerializer(typeof(RssDocument)); - return (RssDocument)ser.Deserialize(source); + var serializer = new XmlSerializer(typeof(RssDocument)); + + return (RssDocument)serializer.Deserialize(source); } public static void WriteRSS(RssDocument value, Stream destination) @@ -131,7 +132,8 @@ public static void WriteRSS(RssDocument value, Stream destination) xsn.Add("dc", "http://purl.org/dc/elements/1.1/"); xsn.Add("content", "http://purl.org/rss/1.0/modules/content/"); - var ser = new XmlSerializer(value.GetType()); - ser.Serialize(destination, value, xsn); + var serializer = new XmlSerializer(value.GetType()); + + serializer.Serialize(destination, value, xsn); } } \ No newline at end of file diff --git a/src/X.Web.RSS/X.Web.RSS.csproj b/src/X.Web.RSS/X.Web.RSS.csproj index f856a70..efc91ea 100644 --- a/src/X.Web.RSS/X.Web.RSS.csproj +++ b/src/X.Web.RSS/X.Web.RSS.csproj @@ -18,12 +18,12 @@ LICENSE.md True - 2.7.0 - 2.7.0.0 - 2.7.0.0 + 2.7.1 + 2.7.1.0 + 2.7.1.0 default enable - net6.0;net8.0;netstandard2.0;netstandard2.1 + net6.0;net8.0;netstandard2.0;netstandard2.1 @@ -33,10 +33,6 @@ - - - - \ No newline at end of file diff --git a/tests/X.Web.RSS.Tests/RSSHelperTest.cs b/tests/X.Web.RSS.Tests/RSSHelperTest.cs index 7203d77..73d48da 100644 --- a/tests/X.Web.RSS.Tests/RSSHelperTest.cs +++ b/tests/X.Web.RSS.Tests/RSSHelperTest.cs @@ -42,14 +42,14 @@ public void Read_External_Ok() [Fact] public void Test() { - var request = WebRequest.Create("https://news.microsoft.com/feed/"); + var request = WebRequest.Create("https://feeds.bbci.co.uk/news/world/rss.xml"); var response = request.GetResponse(); var stream = response.GetResponseStream(); var rss = RssDocument.Load(stream); - Assert.Equal("Stories", rss.Channel.Title); - Assert.Equal("Microsoft news, features, events, and press materials", rss.Channel.Description); + Assert.Equal("BBC News", rss.Channel.Title); + Assert.Equal("BBC News - World", rss.Channel.Description); } private static RssDocument GetFullRss()