Skip to content

Commit

Permalink
Atom10FeedFormatter should generate subtitle tag for Description prop…
Browse files Browse the repository at this point in the history
…erty
  • Loading branch information
linquize committed Jul 23, 2013
1 parent 1609a11 commit 372c612
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -476,7 +476,7 @@ void WriteXml (XmlWriter writer, bool writeRoot)
}

if (Feed.Description != null)
Feed.Description.WriteTo (writer, "description", AtomNamespace);
Feed.Description.WriteTo (writer, "subtitle", AtomNamespace);

if (Feed.ImageUrl != null)
writer.WriteElementString ("logo", AtomNamespace, Feed.ImageUrl.ToString ());
Expand Down
Expand Up @@ -160,6 +160,7 @@ public void WriteTo ()
SyndicationFeed feed = new SyndicationFeed ();
feed.BaseUri = new Uri ("http://mono-project.com");
feed.Copyright = new TextSyndicationContent ("No rights reserved");
feed.Description = new TextSyndicationContent ("A sample feed for unit testing");
feed.Generator = "mono test generator";
// .NET bug: it ignores this value.
feed.Id = "urn:myid";
Expand All @@ -169,7 +170,7 @@ public void WriteTo ()
StringWriter sw = new StringWriter ();
using (XmlWriter w = CreateWriter (sw))
new Atom10FeedFormatter (feed).WriteTo (w);
Assert.AreEqual ("<feed xml:base=\"http://mono-project.com/\" xmlns=\"http://www.w3.org/2005/Atom\"><title type=\"text\"></title><id>XXX</id><rights type=\"text\">No rights reserved</rights><updated>2008-01-01T00:00:00Z</updated><logo>http://mono-project.com/images/mono.png</logo><generator>mono test generator</generator></feed>", DummyId (sw.ToString ()));
Assert.AreEqual ("<feed xml:base=\"http://mono-project.com/\" xmlns=\"http://www.w3.org/2005/Atom\"><title type=\"text\"></title><id>XXX</id><rights type=\"text\">No rights reserved</rights><updated>2008-01-01T00:00:00Z</updated><subtitle type=\"text\">A sample feed for unit testing</subtitle><logo>http://mono-project.com/images/mono.png</logo><generator>mono test generator</generator></feed>", DummyId (sw.ToString ()));
}

[Test]
Expand Down

0 comments on commit 372c612

Please sign in to comment.