public void ShouldHaveEntries()
        {
            var feed = new Feed();
            Assert.AreEqual(0, feed.Items.Count);

            feed.Items.Add(new Entry());
            Assert.AreEqual(1, feed.Items.Count);
        }
        private XDocument FeedInXml(Feed atomFeeds)
        {
            var doc = new XDocument(
                new XDeclaration("1.0", "UTF-8", ""),
                new XElement(ns + "feed",
                             new XElement(ns + "title", atomFeeds.Title),
                             new XElement(ns + "updated", atomFeeds.Updated),
                             new XElement(ns + "author", new XElement(ns + "name", atomFeeds.Author)),
                             new XElement(ns + "id", atomFeeds.Id)
                    ));

            foreach (var item in atomFeeds.Items)
                doc.Element(ns + "feed").Add(EntryInXml(item));

            return doc;
        }
        public string Serialize(object resource)
        {
            if (resource is IEnumerable)
            {
                var feed = new Feed
                {
                    Author = "(author)",
                    Description = "(description)",
                    Title = "(title)",
                    Updated = DateTime.Now.ToRFC3339(),
                    Id = "(feed-url)"
                };

                foreach (var obj in (IEnumerable) resource)
                    feed.Items.Add(GenerateEntry(obj));

                return FeedInXml(feed).ToString();
            }

            return EntryInXml(GenerateEntry(resource)).ToString();
        }