Exemplo n.º 1
0
        public void SimpleChangePriorityTest()
        {
            SearchEngine engine = new SearchEngine();

            InsertSamples(ref engine);

            var results = engine.Find("win").ToArray();

            Assert.IsTrue(results[0] == "D:\\Folder1\\Winfred3;90");
            Assert.IsTrue(results.Length == 4);

            engine.ChangePriority(@"D:\WinFred\index.html", 30);

            var results2 = engine.Find("ind").ToArray();

            Assert.IsTrue(results2[0] == "D:\\WinFred\\index.html;96");

            engine.ChangePriority(@"D:\WinFred\index.html", -30);
            Assert.IsTrue(engine.Find("ind").ToArray()[0] == "D:\\WinFred\\index.html;66");
        }