Пример #1
0
 public void ParseAndCountIndexTest()
 {
     TestLauncherActor.Test(() =>
     {
         var router = new IndexRouter();
         var folder = new DataFolder(source);
         folder.Parse(router, Functer.RimeFuncter);
         var query  = new QueryByIndex("Word");
         var future = new Future <string, IEnumerable <Field> >();
         query.Launch(future, router);
         Task.Delay(5000).Wait();
         var result = future.Result();
         Assert.AreEqual(3, result.Item2.Count());
     });
 }
Пример #2
0
 public void LaunchWithReturnValueTest()
 {
     TestLauncherActor.Test(() =>
     {
         var router = new IndexRouter();
         var folder = new DataFolder(source);
         folder.Parse(router, Functer.RimeFuncter);
         var query   = new QueryByIndex("Word");
         var results = query.Launch(router);
         Task.Delay(5000).Wait();
         foreach (var item in results)
         {
             Assert.AreEqual("Word", item.FieldName);
         }
     });
 }
Пример #3
0
        public void ReceiveAnswerTest()
        {
            const string source = @"Un Deux Trois Quatre";

            TestLauncherActor.Test(() =>
            {
                var indexRouter = new IndexRouter();
                var folder      = new DataFolder(source);
                folder.Parse(indexRouter, Functer.RimeFuncter);
                var folder2 = new DataFolder("a on un en");
                folder2.Parse(indexRouter, Functer.RimeFuncter);

                Task.Delay(5000).Wait();

                var asker = new Future <string, IEnumerable <Field> >();
                var query = new QueryByIndexEqualValue("Rime", "roi");
                query.Launch(asker, indexRouter);
                var result = asker.Result();
                Assert.AreEqual(query.Uuid, result.Item1);
                Assert.AreEqual(folder.Uuid, result.Item2.First().Uuid);
            });
        }