コード例 #1
0
		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);
		}
		public void SetUp()
		{
			// Create the document to be iterated through.
			MockDocument doc = new MockDocument();
			ProvidedDocumentInformation docInfo = new ProvidedDocumentInformation(doc, 
				@"C:\Temp\test.txt", 
				0);
			
			// Create the forward iterator.
			forwardTextIterator = new ForwardTextIterator(docInfo);
		}
		public void SetUp()
		{
			// Create the document to be iterated through.
			MockDocument doc = new MockDocument();
			StringTextBufferStrategy textBufferStrategy = new StringTextBufferStrategy();
			textBufferStrategy.SetContent("bar");
			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);
			
			// Create the forward iterator.
			forwardTextIterator = new ForwardTextIterator(docInfo);
		}
コード例 #4
0
		public void SetUp()
		{
			// Set up SearchOptions required by the BruteForceSearchStrategy.
			SearchOptions.CurrentFindPattern = "foo";
			SearchOptions.MatchCase = false;
			SearchOptions.MatchWholeWord = false;
			
			// Create the document to be searched.
			MockDocument doc = new MockDocument();
			doc.Text = "foo";
			
			// 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);
			
			// Search the document.
//			result = SearchManager.FindNext(SearchOptions.CurrentFindPattern, !SearchOptions.MatchCase, SearchOptions.MatchWholeWord, SearchMode.Normal, 
//			);
		}