public void CanSetAndGetSimpleEntryStatsViewProperties() { string host = UnitTestHelper.GenerateUniqueString(); var repository = new DatabaseObjectProvider(); repository.CreateBlogInternal("title", "blah", "blah", host, string.Empty, 1); UnitTestHelper.SetHttpContextWithBlogRequest(host, string.Empty); BlogRequest.Current.Blog = repository.GetBlog(host, string.Empty); var view = new EntryStatsView(); UnitTestHelper.AssertSimpleProperties(view); }
public void TagDoesNotRetrieveDraftEntry() { string hostname = UnitTestHelper.GenerateUniqueString(); var repository = new DatabaseObjectProvider(); repository.CreateBlogInternal("", "username", "password", hostname, string.Empty, 1); UnitTestHelper.SetHttpContextWithBlogRequest(hostname, string.Empty); BlogRequest.Current.Blog = repository.GetBlog(hostname, string.Empty); Entry entry = UnitTestHelper.CreateEntryInstanceForSyndication("me", "title-zero", "body-zero"); entry.IsActive = false; UnitTestHelper.Create(entry); var tags = new List<string>(new[] { "Tag1", "Tag2" }); new DatabaseObjectProvider().SetEntryTagList(entry.Id, tags); ICollection<Entry> entries = repository.GetEntriesByTag(1, "Tag1"); Assert.AreEqual(0, entries.Count, "Should not retrieve draft entry."); }