/Source Code/UnitTests/Searching and Indexing/BaseSearchTester.vb
Visual Basic | 53 lines | 38 code | 15 blank | 0 comment | 0 complexity | 77110bde0662fc6a1bf40f856c951163 MD5 | raw file
- Imports System.Collections.Generic
- Imports Microsoft.VisualStudio.TestTools.UnitTesting
- Imports System.IO
- Imports PowerSong.FastSearching
-
- Public Class BaseSearchTester
-
- Private Shared FTemporaryFiles As New List(Of String)
-
- Protected Shared Function GetTemporaryFileName() As String
-
- Dim Result As String = Guid.NewGuid.ToString + ".Temp"
- FTemporaryFiles.Add(Result)
- Return Result
-
- End Function
-
- Protected Shared Sub RemoveTemporaryFiles()
-
- For Each FileName As String In FTemporaryFiles
- File.Delete(FileName)
- Next
- FTemporaryFiles.Clear()
-
- End Sub
-
- <CLSCompliant(False)> _
- Protected Shared Function CreateBasicIndex() As Indexer
-
- Dim Index As New Indexer
- Index.AddFileContentsToIndex("A", "Contents of first file.")
- Index.AddFileContentsToIndex("B", "Contents of second file.")
- Index.AddFileContentsToIndex("C", "Contents of third file.")
- Return Index
-
- End Function
-
- <CLSCompliant(False)> _
- Protected Shared Function CreateModerateIndex() As Indexer
-
- Dim Index As New Indexer
- Index.AddFileContentsToIndex("A", "This is the first file. ALL THREE TWO forceTop")
- Index.AddFileContentsToIndex("B", "This is the second file. ALL SIX")
- Index.AddFileContentsToIndex("C", "This is the third file. ALL SIX FIVE FOUR")
- Index.AddFileContentsToIndex("D", "This is the fourth file. ALL SIX FIVE FOUR THREE TWO ONE")
- Index.AddFileContentsToIndex("E", "This is the fifth file. ALL SIX FIVE FOUR")
- Index.AddFileContentsToIndex("F", "This is the sixth file. ALL SIX FIVE FOUR")
- Index.AddFileContentsToIndex("G", "This is the seventh file. ALL SIX FIVE THREE")
- Return Index
-
- End Function
-
- End Class