Removing unused methods and refactoring the batch loop

--HG--
branch : indexing
This commit is contained in:
Sebastien Ros
2011-03-04 16:21:19 -08:00
parent 6d3dffd77e
commit 599d892f48
5 changed files with 145 additions and 135 deletions

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Autofac;
using Lucene.Services;
using Moq;
@@ -176,6 +175,7 @@ namespace Orchard.Tests.Modules.Indexing {
// there should be nothing done
_indexNotifier.UpdateIndex(IndexName);
Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1));
_contentManager.Create<Thing>(ThingDriver.ContentTypeName).Text = "Lorem ipsum";
_indexNotifier.UpdateIndex(IndexName);
@@ -216,6 +216,17 @@ namespace Orchard.Tests.Modules.Indexing {
Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(1));
}
[Test]
public void ShouldIndexAllContentOverTheLoopSize() {
for (int i = 0; i < 999; i++) {
var content = _contentManager.Create<Thing>(ThingDriver.ContentTypeName);
content.Text = "Lorem ipsum " + i;
}
_indexNotifier.UpdateIndex(IndexName);
Assert.That(_provider.NumDocs(IndexName), Is.EqualTo(999));
}
#region Stubs
public class ThingHandler : ContentHandler {
public ThingHandler() {