public void TestScan() { DocumentIndex index = new DocumentIndex(IndexDir); PluginManager plugin = new PluginManager(); plugin.Load(); index.PluginManager = plugin; index.Add(document1A); index.Scan(); foreach (var doc in index.DocumentIdentity) { Assert.IsTrue(doc.State == IndexationStates.Indexed, "All documents must be index after a scan"); } }
public void TestQuery() { DocumentIndex index = new DocumentIndex(IndexDir); PluginManager plugin = new PluginManager(); plugin.Load(); index.PluginManager = plugin; index.Add(document1A); index.Scan(); var result = index.Search( String.Format("Name:\"{0}\"", Path.GetFileNameWithoutExtension(document1A.FilePath))); Assert.IsTrue(result.Count() == 1, "Should found 1 doc, found = {0}", result.Count()); }
public void TestLoadCorePlugin() { PluginManager pMan = new PluginManager(); pMan.Load(); Assert.IsTrue(pMan.IsInitialized, "The plugin manager should be initialized after a load"); }
public void TestCorePluginAreLoaded() { PluginManager pMan = new PluginManager(); pMan.Load(); Assert.IsTrue(pMan.Parsers.Count() == 3, "There is 3 parser in the LucyLib"); }
/// <summary> /// Dispose unmanaged ressource /// </summary> /// <param name="dispose">Should dispose non managed ressource</param> protected virtual void Dispose(bool dispose) { if (dispose) { if (indexStore != null) { indexStore.Dispose(); indexStore = null; PluginManager = null; this.DocumentIdentity = null; GC.SuppressFinalize(this); this.disposed = true; } } }