public void CanDeleteEntryMetaTag() { var blog = UnitTestHelper.CreateBlogAndSetupContext(); Entry entry = UnitTestHelper.CreateEntryInstanceForSyndication("Steven Harman", "Sweet arse entry!", "Giddy, giddy, goo!"); UnitTestHelper.Create(entry); MetaTag tag = UnitTestHelper.BuildMetaTag("Foo, bar, zaa?", "author", null, blog.Id, entry.Id, DateTime.Now); MetaTags.Create(tag); Assert.AreEqual(1, MetaTags.GetMetaTagsForBlog(blog, 0, 100).Count, "Should be one (1) MetaTag for this blog."); Assert.AreEqual(1, MetaTags.GetMetaTagsForEntry(entry, 0, 100).Count, "Should be one (1) MetaTag for this entry."); // Now let's remove it from the data store Assert.IsTrue(MetaTags.Delete(tag.Id), "Deleting the MetaTag failed."); Assert.AreEqual(0, MetaTags.GetMetaTagsForBlog(blog, 0, 100).Count, "Should be zero (0) MetaTags for this blog."); Assert.AreEqual(0, MetaTags.GetMetaTagsForEntry(entry, 0, 100).Count, "Should be zero (0) MetaTag for this entry."); }
public void GetReturnsZeroWhenNoMetaTagsExistForEntry() { blog = UnitTestHelper.CreateBlogAndSetupContext(); Entry e = UnitTestHelper.CreateEntryInstanceForSyndication("Steve Harman", "Loves Subtexting!", "Roses are red..."); UnitTestHelper.Create(e); Assert.AreEqual(0, MetaTags.GetMetaTagsForEntry(e, 0, 100).Count, "Shouldn't have found any MetaTags for this entry."); }
public void CanGetMetaTagsForEntry() { blog = UnitTestHelper.CreateBlogAndSetupContext(); Entry e = UnitTestHelper.CreateEntryInstanceForSyndication("Steve-o", "Bar", "Steve is still rockin it... or is he?"); UnitTestHelper.Create(e); InsertNewMetaTag("Adding description meta tag", "description", null, DateTime.Now, blog.Id, null); InsertNewMetaTag("no-cache", null, "cache-control", DateTime.Now, blog.Id, null); // insert a few entry specific tags InsertNewMetaTag("Yet Another MetaTag", "author", null, DateTime.Now, blog.Id, e.Id); InsertNewMetaTag("One more for good measure", "description", null, DateTime.Now, blog.Id, e.Id); InsertNewMetaTag("no-cache", null, "cache-control", DateTime.Now, blog.Id, e.Id); InsertNewMetaTag("Mon, 22 Jul 2022 11:12:01 GMT", null, "expires", DateTime.Now, blog.Id, e.Id); ICollection <MetaTag> tags = MetaTags.GetMetaTagsForEntry(e, 0, 100); Assert.AreEqual(4, tags.Count, "Should have found 4 MetaTags for this entry."); }