public void TestThatAllWebPagesAreInTheIndex() { int minID; int maxID; SqlCommand sqlCommand = new SqlCommand("Select Min(ID) From WebPages"); sqlCommand.Connection = new SqlConnection("Data Source=.;Initial Catalog=arachnode.net;Integrated Security=True;Connection Timeout=3600;"); sqlCommand.Connection.Open(); using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader()) { sqlDataReader.Read(); minID = int.Parse(sqlDataReader.GetValue(0).ToString()); } sqlCommand.CommandText = "Select Max(ID) From WebPages"; using (SqlDataReader sqlDataReader = sqlCommand.ExecuteReader()) { sqlDataReader.Read(); maxID = int.Parse(sqlDataReader.GetValue(0).ToString()); } ApplicationSettings applicationSettings = new ApplicationSettings(); ArachnodeDAO arachnodeDAO = new ArachnodeDAO(applicationSettings.ConnectionString); IndexSearcher _indexSearcher = new IndexSearcher(FSDirectory.Open(new DirectoryInfo("M:\\LDNI")), true); StandardAnalyzer standardAnalyzer = new StandardAnalyzer(); QueryParser queryParser = new QueryParser("discoveryid", standardAnalyzer); for (int i = minID; i <= maxID; i++) { Debug.Print(i.ToString()); ArachnodeDataSet.WebPagesRow webPagesRow = arachnodeDAO.GetWebPage(i.ToString()); Query query = queryParser.Parse("\"" + webPagesRow.ID + "\""); Hits hits = _indexSearcher.Search(query); bool constainsTheWebPageAbsoluteUri = false; for (int j = 0; j < hits.Length(); j++) { if (hits.Doc(j).GetField("discoverytype").StringValue() == "webpage") { constainsTheWebPageAbsoluteUri = true; } } if (!constainsTheWebPageAbsoluteUri) { //ANODET: Set Breakpoint... } Assert.IsTrue(constainsTheWebPageAbsoluteUri); } sqlCommand.Connection.Close(); }