public void RebuildIndex_WithEntryNotPublished_DoesntAddsDataToIndex()
        {
            var context = new Mock<ISubtextContext>();
            var repository = new Mock<ObjectProvider>();
            repository.Setup(r => r.GetEntries(PostType.BlogPost, null, It.IsAny<int>(), It.IsAny<int>())).Returns(
                BuildFakeCollectionNotPublished());
            context.Setup(c => c.Repository).Returns(repository.Object);

            var indexService = new IndexingService(context.Object, _service);

            indexService.RebuildIndex();

            Assert.AreEqual(0, _service.GetTotalIndexedEntryCount());
        }
        public void RebuildIndex_LoadEntriesFromRepository()
        {
            var context = new Mock<ISubtextContext>();
            var repository = new Mock<ObjectProvider>();
            repository.Setup(r => r.GetEntries(PostType.BlogPost, null, It.IsAny<int>(), It.IsAny<int>())).Returns(
                new PagedCollection<EntryStatsView>());
            context.Setup(c => c.Repository).Returns(repository.Object);

            var indexService = new IndexingService(context.Object, _service);

            indexService.RebuildIndex();

            repository.Verify(rep => rep.GetEntries(PostType.BlogPost, null, It.IsAny<int>(), It.IsAny<int>()));
        }