public void SetUp()
{
// Set up SearchOptions required by the BruteForceSearchStrategy.
SearchOptions.CurrentFindPattern = "foo";
SearchOptions.MatchCase = false;
SearchOptions.MatchWholeWord = false;
// Create search.
search = new Search();
search.TextIteratorBuilder = new ForwardTextIteratorBuilder();
search.SearchStrategy = new BruteForceSearchStrategy();
MockCurrentDocumentIterator currentDocIterator = new MockCurrentDocumentIterator();
search.DocumentIterator = currentDocIterator;
// Create the document to be searched.
MockDocument doc = new MockDocument();
StringTextBufferStrategy textBufferStrategy = new StringTextBufferStrategy();
textBufferStrategy.SetContent("foo");
doc.TextBufferStrategy = textBufferStrategy;
// Create a doc info with an initial end offset right
// at the end of the text.
ProvidedDocumentInformation docInfo = new ProvidedDocumentInformation(doc, @"C:\Temp\test.txt", doc.TextLength);
currentDocIterator.Current = docInfo;
currentDocIterator.CurrentFileName = docInfo.FileName;
// Search the document.
search.SearchStrategy.CompilePattern(null);
result = search.FindNext(null);
}