<commit_before>#region Disclaimer/Info
///////////////////////////////////////////////////////////////////////////////////////////////////
// Subtext WebLog
// 
// Subtext is an open source weblog system that is a fork of the .TEXT
// weblog system.
//
// For updated news and information please visit http://subtextproject.com/
// Subtext is hosted at SourceForge at http://sourceforge.net/projects/subtext
// The development mailing list is at <EMAIL> 
//
// This project is licensed under the BSD license.  See the License.txt file for more information.
///////////////////////////////////////////////////////////////////////////////////////////////////
#endregion

using System;
using System.Web;
using MbUnit.Framework;
using Subtext.Common.Syndication;
using Subtext.Extensibility;
using Subtext.Framework;
using Subtext.Framework.Components;
using Subtext.Framework.Configuration;

namespace UnitTests.Subtext.Framework.Syndication
{
	/// <summary>
	/// Unit tests for the RSSWriter classes.
	/// </summary>
	[TestFixture]
	public class RssWriterTests
	{
		/// <summary>
		/// Tests writing a simple RSS feed.
		/// </summary>
		[Test]
		public void RssWriterProducesValidFeed()
		{
			UnitTestHelper.SetHttpContextWithBlogRequest("localhost", "Subtext.Web");

			BlogInfo blogInfo = new BlogInfo();
			blogInfo.Host = "localhost";
			blogInfo.Application = "Subtext.Web";
			blogInfo.Email = "<EMAIL>";
			blogInfo.RFC3229DeltaEncodingEnabled = true;

			HttpContext.Current.Items.Add("BlogInfo-", blogInfo);

			EntryCollection entries = new EntryCollection(CreateSomeEntries());		
			RssWriter writer = new RssWriter(entries, NullValue.NullDateTime, false);

			string expected = @"<rss version=""2.0"" xmlns:dc=""http://purl.org/dc/elements/1.1/"" xmlns:trackback=""http://madskills.com/public/xml/rss/module/trackback/"" xmlns:wfw=""http://wellformedweb.org/CommentAPI/"" xmlns:slash=""http://purl.org/rss/1.0/modules/slash/"" xmlns:copyright=""http://blogs.law.harvard.edu/tech/rss"" xmlns:image=""http://purl.org/rss/1.0/modules/image/""><channel><title /><link>http://localhost/Subtext.Web/Default.aspx</link><description /><language>en-US</language><copyright>Subtext Weblog</copyright><managingEditor><EMAIL></managingEditor><generator>Subtext Version 0.9.9.9</generator><image><title /><url>http://localhost/Subtext.Web/RSS2Image.gif</url><link>http://localhost/Subtext.Web/Default.aspx</link><width>77</width><height>60</height><description /></image>" 
							+ @"<item><title>Title of 1001.</title><link>http://localhost/Subtext.Web/archive/1975/01/23/1001</link><description>Body of 1001&lt;img src =""http://localhost/Subtext.Web/aggbug/1001.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1975/01/23/1001</guid><pubDate>Thu, 23 Jan 1975 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1975/01/23/1001#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1001.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1002.</title><link>http://localhost/Subtext.Web/archive/1976/05/25/1002</link><description>Body of 1002&lt;img src =""http://localhost/Subtext.Web/aggbug/1002.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1976/05/25/1002</guid><pubDate>Tue, 25 May 1976 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1976/05/25/1002#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1002.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1003.</title><link>http://localhost/Subtext.Web/archive/1979/09/16/1003</link><description>Body of 1003&lt;img src =""http://localhost/Subtext.Web/aggbug/1003.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1979/09/16/1003</guid><pubDate>Sun, 16 Sep 1979 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1979/09/16/1003#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1003.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1004.</title><link>http://localhost/Subtext.Web/archive/2003/06/14/1004</link><description>Body of 1004&lt;img src =""http://localhost/Subtext.Web/aggbug/1004.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/2003/06/14/1004</guid><pubDate>Sat, 14 Jun 2003 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/2003/06/14/1004#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1004.aspx</wfw:commentRss></item></channel></rss>";
			
			Console.WriteLine(expected);
			Console.WriteLine(writer.Xml);
			Assert.AreEqual(expected, writer.Xml);			
		}

		/// <summary>
		/// Makes sure the RSS Writer can write the delta of a feed based 
		/// on the RFC3229 with feeds 
		/// <see href="http://bobwyman.pubsub.com/main/2004/09/using_rfc3229_w.html"/>.
		/// </summary>
		[Test]
		[RollBack]
		public void RssWriterHandlesRFC3229DeltaEncoding()
		{
			UnitTestHelper.SetHttpContextWithBlogRequest("localhost", "Subtext.Web");

			BlogInfo blogInfo = new BlogInfo();
			blogInfo.Host = "localhost";
			blogInfo.Application = "Subtext.Web";
			blogInfo.Email = "<EMAIL>";
			blogInfo.RFC3229DeltaEncodingEnabled = true;

			HttpContext.Current.Items.Add("BlogInfo-", blogInfo);

			EntryCollection entries = new EntryCollection(CreateSomeEntriesDescending());
			// Tell the write we already received 1002 published 5/25/1976.
			RssWriter writer = new RssWriter(entries, DateTime.Parse("5/25/1976"), true);
			
			// We only expect 1003 and 1004
			string expected = @"<rss version=""2.0"" xmlns:dc=""http://purl.org/dc/elements/1.1/"" xmlns:trackback=""http://madskills.com/public/xml/rss/module/trackback/"" xmlns:wfw=""http://wellformedweb.org/CommentAPI/"" xmlns:slash=""http://purl.org/rss/1.0/modules/slash/"" xmlns:copyright=""http://blogs.law.harvard.edu/tech/rss"" xmlns:image=""http://purl.org/rss/1.0/modules/image/""><channel><title /><link>http://localhost/Subtext.Web/Default.aspx</link><description /><language>en-US</language><copyright>Subtext Weblog</copyright><managingEditor><EMAIL></managingEditor><generator>Subtext Version 0.9.9.9</generator><image><title /><url>http://localhost/Subtext.Web/RSS2Image.gif</url><link>http://localhost/Subtext.Web/Default.aspx</link><width>77</width><height>60</height><description /></image>" 
							+ @"<item><title>Title of 1004.</title><link>http://localhost/Subtext.Web/archive/2003/06/14/1004</link><description>Body of 1004&lt;img src =""http://localhost/Subtext.Web/aggbug/1004.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/2003/06/14/1004</guid><pubDate>Sat, 14 Jun 2003 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/2003/06/14/1004#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1004.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1003.</title><link>http://localhost/Subtext.Web/archive/1979/09/16/1003</link><description>Body of 1003&lt;img src =""http://localhost/Subtext.Web/aggbug/1003.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1979/09/16/1003</guid><pubDate>Sun, 16 Sep 1979 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1979/09/16/1003#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1003.aspx</wfw:commentRss></item></channel></rss>";
			
			Assert.AreEqual(expected, writer.Xml);

			Assert.AreEqual(DateTime.Parse("5/25/1976"), writer.DateLastViewedFeedItemPublished, "The Item ID Last Viewed (according to If-None-Since is wrong.");
			Assert.AreEqual(DateTime.Parse("6/14/2003"), writer.LatestPublishDate, "The Latest Feed Item ID sent to the client is wrong.");
		}

		/// <summary>
		/// Tests writing a simple RSS feed.
		/// </summary>
		[Test]
		public void RssWriterSendsWholeFeedWhenRFC3229Disabled()
		{
			UnitTestHelper.SetHttpContextWithBlogRequest("localhost", "Subtext.Web");

			BlogInfo blogInfo = new BlogInfo();
			blogInfo.Host = "localhost";
			blogInfo.Application = "Subtext.Web";
			blogInfo.Email = "<EMAIL>";
			blogInfo.RFC3229DeltaEncodingEnabled = false;

			HttpContext.Current.Items.Add("BlogInfo-", blogInfo);

			EntryCollection entries = new EntryCollection(CreateSomeEntriesDescending());		
			RssWriter writer = new RssWriter(entries, DateTime.Parse("6/14/2003"), false);

			string expected = @"<rss version=""2.0"" xmlns:dc=""http://purl.org/dc/elements/1.1/"" xmlns:trackback=""http://madskills.com/public/xml/rss/module/trackback/"" xmlns:wfw=""http://wellformedweb.org/CommentAPI/"" xmlns:slash=""http://purl.org/rss/1.0/modules/slash/"" xmlns:copyright=""http://blogs.law.harvard.edu/tech/rss"" xmlns:image=""http://purl.org/rss/1.0/modules/image/""><channel><title /><link>http://localhost/Subtext.Web/Default.aspx</link><description /><language>en-US</language><copyright>Subtext Weblog</copyright><managingEditor><EMAIL></managingEditor><generator>Subtext Version 0.9.9.9</generator><image><title /><url>http://localhost/Subtext.Web/RSS2Image.gif</url><link>http://localhost/Subtext.Web/Default.aspx</link><width>77</width><height>60</height><description /></image>" 
							+ @"<item><title>Title of 1004.</title><link>http://localhost/Subtext.Web/archive/2003/06/14/1004</link><description>Body of 1004&lt;img src =""http://localhost/Subtext.Web/aggbug/1004.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/2003/06/14/1004</guid><pubDate>Sat, 14 Jun 2003 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/2003/06/14/1004#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1004.aspx</wfw:commentRss></item>"
							+ @"<item><title>Title of 1003.</title><link>http://localhost/Subtext.Web/archive/1979/09/16/1003</link><description>Body of 1003&lt;img src =""http://localhost/Subtext.Web/aggbug/1003.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1979/09/16/1003</guid><pubDate>Sun, 16 Sep 1979 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1979/09/16/1003#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1003.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1002.</title><link>http://localhost/Subtext.Web/archive/1976/05/25/1002</link><description>Body of 1002&lt;img src =""http://localhost/Subtext.Web/aggbug/1002.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1976/05/25/1002</guid><pubDate>Tue, 25 May 1976 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1976/05/25/1002#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1002.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1001.</title><link>http://localhost/Subtext.Web/archive/1975/01/23/1001</link><description>Body of 1001&lt;img src =""http://localhost/Subtext.Web/aggbug/1001.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1975/01/23/1001</guid><pubDate>Thu, 23 Jan 1975 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1975/01/23/1001#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1001.aspx</wfw:commentRss></item></channel></rss>";
			
			Assert.AreEqual(expected, writer.Xml);			
		}

		Entry[] CreateSomeEntries()
		{
			return new Entry[]
			{
				CreateEntry(1001, "Title of 1001.", "Body of 1001", DateTime.Parse("1/23/1975"))
				,CreateEntry(1002, "Title of 1002.", "Body of 1002", DateTime.Parse("5/25/1976"))
				,CreateEntry(1003, "Title of 1003.", "Body of 1003", DateTime.Parse("9/16/1979"))
				,CreateEntry(1004, "Title of 1004.", "Body of 1004", DateTime.Parse("6/14/2003"))
			};<commit_msg>Fixed unit tests so they don't break when we update the dll version number.<commit_after>#region Disclaimer/Info
///////////////////////////////////////////////////////////////////////////////////////////////////
// Subtext WebLog
// 
// Subtext is an open source weblog system that is a fork of the .TEXT
// weblog system.
//
// For updated news and information please visit http://subtextproject.com/
// Subtext is hosted at SourceForge at http://sourceforge.net/projects/subtext
// The development mailing list is at <EMAIL> 
//
// This project is licensed under the BSD license.  See the License.txt file for more information.
///////////////////////////////////////////////////////////////////////////////////////////////////
#endregion

using System;
using System.Web;
using MbUnit.Framework;
using Subtext.Common.Syndication;
using Subtext.Extensibility;
using Subtext.Framework;
using Subtext.Framework.Components;
using Subtext.Framework.Configuration;

namespace UnitTests.Subtext.Framework.Syndication
{
	/// <summary>
	/// Unit tests for the RSSWriter classes.
	/// </summary>
	[TestFixture]
	public class RssWriterTests
	{
		/// <summary>
		/// Tests writing a simple RSS feed.
		/// </summary>
		[Test]
		public void RssWriterProducesValidFeed()
		{
			UnitTestHelper.SetHttpContextWithBlogRequest("localhost", "Subtext.Web");

			BlogInfo blogInfo = new BlogInfo();
			blogInfo.Host = "localhost";
			blogInfo.Application = "Subtext.Web";
			blogInfo.Email = "<EMAIL>";
			blogInfo.RFC3229DeltaEncodingEnabled = true;

			HttpContext.Current.Items.Add("BlogInfo-", blogInfo);

			EntryCollection entries = new EntryCollection(CreateSomeEntries());		
			RssWriter writer = new RssWriter(entries, NullValue.NullDateTime, false);

			string expected = @"<rss version=""2.0"" xmlns:dc=""http://purl.org/dc/elements/1.1/"" xmlns:trackback=""http://madskills.com/public/xml/rss/module/trackback/"" xmlns:wfw=""http://wellformedweb.org/CommentAPI/"" xmlns:slash=""http://purl.org/rss/1.0/modules/slash/"" xmlns:copyright=""http://blogs.law.harvard.edu/tech/rss"" xmlns:image=""http://purl.org/rss/1.0/modules/image/""><channel><title /><link>http://localhost/Subtext.Web/Default.aspx</link><description /><language>en-US</language><copyright>Subtext Weblog</copyright><managingEditor><EMAIL></managingEditor><generator>{0}</generator><image><title /><url>http://localhost/Subtext.Web/RSS2Image.gif</url><link>http://localhost/Subtext.Web/Default.aspx</link><width>77</width><height>60</height><description /></image>" 
							+ @"<item><title>Title of 1001.</title><link>http://localhost/Subtext.Web/archive/1975/01/23/1001</link><description>Body of 1001&lt;img src =""http://localhost/Subtext.Web/aggbug/1001.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1975/01/23/1001</guid><pubDate>Thu, 23 Jan 1975 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1975/01/23/1001#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1001.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1002.</title><link>http://localhost/Subtext.Web/archive/1976/05/25/1002</link><description>Body of 1002&lt;img src =""http://localhost/Subtext.Web/aggbug/1002.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1976/05/25/1002</guid><pubDate>Tue, 25 May 1976 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1976/05/25/1002#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1002.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1003.</title><link>http://localhost/Subtext.Web/archive/1979/09/16/1003</link><description>Body of 1003&lt;img src =""http://localhost/Subtext.Web/aggbug/1003.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1979/09/16/1003</guid><pubDate>Sun, 16 Sep 1979 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1979/09/16/1003#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1003.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1004.</title><link>http://localhost/Subtext.Web/archive/2003/06/14/1004</link><description>Body of 1004&lt;img src =""http://localhost/Subtext.Web/aggbug/1004.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/2003/06/14/1004</guid><pubDate>Sat, 14 Jun 2003 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/2003/06/14/1004#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1004.aspx</wfw:commentRss></item></channel></rss>";

			expected = string.Format(expected, VersionInfo.VersionDisplayText);
			
			Console.WriteLine(expected);
			Console.WriteLine(writer.Xml);
			Assert.AreEqual(expected, writer.Xml);			
		}

		/// <summary>
		/// Makes sure the RSS Writer can write the delta of a feed based 
		/// on the RFC3229 with feeds 
		/// <see href="http://bobwyman.pubsub.com/main/2004/09/using_rfc3229_w.html"/>.
		/// </summary>
		[Test]
		[RollBack]
		public void RssWriterHandlesRFC3229DeltaEncoding()
		{
			UnitTestHelper.SetHttpContextWithBlogRequest("localhost", "Subtext.Web");

			BlogInfo blogInfo = new BlogInfo();
			blogInfo.Host = "localhost";
			blogInfo.Application = "Subtext.Web";
			blogInfo.Email = "<EMAIL>";
			blogInfo.RFC3229DeltaEncodingEnabled = true;

			HttpContext.Current.Items.Add("BlogInfo-", blogInfo);

			EntryCollection entries = new EntryCollection(CreateSomeEntriesDescending());
			// Tell the write we already received 1002 published 5/25/1976.
			RssWriter writer = new RssWriter(entries, DateTime.Parse("5/25/1976"), true);
			
			// We only expect 1003 and 1004
			string expected = @"<rss version=""2.0"" xmlns:dc=""http://purl.org/dc/elements/1.1/"" xmlns:trackback=""http://madskills.com/public/xml/rss/module/trackback/"" xmlns:wfw=""http://wellformedweb.org/CommentAPI/"" xmlns:slash=""http://purl.org/rss/1.0/modules/slash/"" xmlns:copyright=""http://blogs.law.harvard.edu/tech/rss"" xmlns:image=""http://purl.org/rss/1.0/modules/image/""><channel><title /><link>http://localhost/Subtext.Web/Default.aspx</link><description /><language>en-US</language><copyright>Subtext Weblog</copyright><managingEditor><EMAIL></managingEditor><generator>{0}</generator><image><title /><url>http://localhost/Subtext.Web/RSS2Image.gif</url><link>http://localhost/Subtext.Web/Default.aspx</link><width>77</width><height>60</height><description /></image>" 
							+ @"<item><title>Title of 1004.</title><link>http://localhost/Subtext.Web/archive/2003/06/14/1004</link><description>Body of 1004&lt;img src =""http://localhost/Subtext.Web/aggbug/1004.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/2003/06/14/1004</guid><pubDate>Sat, 14 Jun 2003 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/2003/06/14/1004#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1004.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1003.</title><link>http://localhost/Subtext.Web/archive/1979/09/16/1003</link><description>Body of 1003&lt;img src =""http://localhost/Subtext.Web/aggbug/1003.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1979/09/16/1003</guid><pubDate>Sun, 16 Sep 1979 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1979/09/16/1003#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1003.aspx</wfw:commentRss></item></channel></rss>";
			
			expected = string.Format(expected, VersionInfo.VersionDisplayText);

			Assert.AreEqual(expected, writer.Xml);

			Assert.AreEqual(DateTime.Parse("5/25/1976"), writer.DateLastViewedFeedItemPublished, "The Item ID Last Viewed (according to If-None-Since is wrong.");
			Assert.AreEqual(DateTime.Parse("6/14/2003"), writer.LatestPublishDate, "The Latest Feed Item ID sent to the client is wrong.");
		}

		/// <summary>
		/// Tests writing a simple RSS feed.
		/// </summary>
		[Test]
		public void RssWriterSendsWholeFeedWhenRFC3229Disabled()
		{
			UnitTestHelper.SetHttpContextWithBlogRequest("localhost", "Subtext.Web");

			BlogInfo blogInfo = new BlogInfo();
			blogInfo.Host = "localhost";
			blogInfo.Application = "Subtext.Web";
			blogInfo.Email = "<EMAIL>";
			blogInfo.RFC3229DeltaEncodingEnabled = false;

			HttpContext.Current.Items.Add("BlogInfo-", blogInfo);

			EntryCollection entries = new EntryCollection(CreateSomeEntriesDescending());		
			RssWriter writer = new RssWriter(entries, DateTime.Parse("6/14/2003"), false);

			string expected = @"<rss version=""2.0"" xmlns:dc=""http://purl.org/dc/elements/1.1/"" xmlns:trackback=""http://madskills.com/public/xml/rss/module/trackback/"" xmlns:wfw=""http://wellformedweb.org/CommentAPI/"" xmlns:slash=""http://purl.org/rss/1.0/modules/slash/"" xmlns:copyright=""http://blogs.law.harvard.edu/tech/rss"" xmlns:image=""http://purl.org/rss/1.0/modules/image/""><channel><title /><link>http://localhost/Subtext.Web/Default.aspx</link><description /><language>en-US</language><copyright>Subtext Weblog</copyright><managingEditor><EMAIL></managingEditor><generator>{0}</generator><image><title /><url>http://localhost/Subtext.Web/RSS2Image.gif</url><link>http://localhost/Subtext.Web/Default.aspx</link><width>77</width><height>60</height><description /></image>" 
							+ @"<item><title>Title of 1004.</title><link>http://localhost/Subtext.Web/archive/2003/06/14/1004</link><description>Body of 1004&lt;img src =""http://localhost/Subtext.Web/aggbug/1004.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/2003/06/14/1004</guid><pubDate>Sat, 14 Jun 2003 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/2003/06/14/1004#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1004.aspx</wfw:commentRss></item>"
							+ @"<item><title>Title of 1003.</title><link>http://localhost/Subtext.Web/archive/1979/09/16/1003</link><description>Body of 1003&lt;img src =""http://localhost/Subtext.Web/aggbug/1003.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1979/09/16/1003</guid><pubDate>Sun, 16 Sep 1979 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1979/09/16/1003#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1003.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1002.</title><link>http://localhost/Subtext.Web/archive/1976/05/25/1002</link><description>Body of 1002&lt;img src =""http://localhost/Subtext.Web/aggbug/1002.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1976/05/25/1002</guid><pubDate>Tue, 25 May 1976 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1976/05/25/1002#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1002.aspx</wfw:commentRss></item>" 
							+ @"<item><title>Title of 1001.</title><link>http://localhost/Subtext.Web/archive/1975/01/23/1001</link><description>Body of 1001&lt;img src =""http://localhost/Subtext.Web/aggbug/1001.aspx"" width = ""1"" height = ""1"" /&gt;</description><guid>http://localhost/Subtext.Web/archive/1975/01/23/1001</guid><pubDate>Thu, 23 Jan 1975 00:00:00 GMT</pubDate><comments>http://localhost/Subtext.Web/archive/1975/01/23/1001#feedback</comments><wfw:commentRss>http://localhost/Subtext.Web/comments/commentRss/1001.aspx</wfw:commentRss></item></channel></rss>";
			expected = string.Format(expected, VersionInfo.VersionDisplayText);
			Assert.AreEqual(expected, writer.Xml);			
		}

		Entry[] CreateSomeEntries()
		{
			return new Entry[]
			{
				CreateEntry(1001, "Title of 1001.", "Body of 1001", DateTime.Parse("1/23/1975"))
				,CreateEntry(1002, "Title of 1002.", "Body of 1002", DateTime.Parse("5/25/1976"))
				,CreateEntry(1003, "Title of 1003.", "Body of 1003", DateTime.Parse("9/16/1979"))
				,CreateEntry(1004, "Title of 1004.", "Body of 1004", DateTime.Parse("6/14/2003"))
			};
{'fraction_non_alphanumeric': 0.2056483199340342, 'fraction_numerical': 0.07120181405895691, 'mean_word_length': 4.7086373264297485, 'pattern_counts': {'":': 0, '<': 523, '<?xml version=': 0, '>': 523, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 42}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5221446', 'n_tokens_mistral': 9560, 'n_tokens_neox': 7774, 'n_words': 1062}