コード例 #1
0
        public void AddBlacklist()
        {
            IUpdateProxy <string> up = _session.CreateBlacklistUpdateProxy();

            up.Add("net*");
            int res = _session.UpdateBlacklist(up);

            Assert.IsTrue(res == 202, "RESULT: " + res);

            //Remove blacklist
            IList <string> result = _session.GetBlacklist();

            Assert.IsNotNull(result);

            up = _session.CreateBlacklistUpdateProxy();
            foreach (string item in result)
            {
                if (item == "net*")
                {
                    up.Remove(item);
                }
            }

            res = _session.UpdateBlacklist(up);
            Assert.IsTrue(res == 202, "RESULT: " + res);
        }
コード例 #2
0
        public void UpdateConfiguration()
        {
            IList <Configuration> result = _session.GetConfigurations();

            Assert.IsNotNull(result);
            if (result == null)
            {
                return;
            }

            IUpdateProxy <Configuration> up = _session.CreateConfigurationsUpdateProxy();

            foreach (Configuration item in result)
            {
                if (item.Name == "default")
                {
                    item.AutoResponding = false;
                    item.CharsThreshold = 5;
                    up.Add(item);
                    //up.Remove(item);
                }
            }
            int res = _session.UpdateConfigurations(up);

            Assert.IsTrue(res == 202, "RESULT: " + res);
        }
コード例 #3
0
        public void AddEntities()
        {
            IUpdateProxy <UserEntity> up = _session.CreateEntitiesUpdateProxy();

            up.Add(new UserEntity {
                Name = "NET", Type = "Language"
            });
            int res = _session.UpdateEntities(up);

            Assert.IsTrue(res == 202, "RESULT: " + res);

            // Remove created entity
            RemoveEntities();
        }
コード例 #4
0
        public void AddSentimentPhrases()
        {
            IUpdateProxy <SentimentPhrase> up = _session.CreateSentimentPhrasesUpdateProxy();

            up.Add(new SentimentPhrase {
                Title = "NET", Weight = 0.1f
            });
            int res = _session.UpdateSentimentPhrases(up);

            Assert.IsTrue(res == 202, "RESULT: " + res);

            //Remove created sentiment phrase
            RemoveSentimentPhrases();
        }
コード例 #5
0
        public void AddQueries()
        {
            IUpdateProxy <Query> up = _session.CreateQueriesUpdateProxy();

            up.Add(new Query {
                Name = "NET", Content = "Data"
            });
            int res = _session.UpdateQueries(up);

            Assert.IsTrue(res == 202, "RESULT: " + res);

            //Remove created query
            RemoveQueries();
        }
コード例 #6
0
        public void AddCategories()
        {
            IUpdateProxy <Category> up = _session.CreateCategoriesUpdateProxy();

            up.Add(new Category {
                Name = "NET"
            });
            int res = _session.UpdateCategories(up);

            Assert.IsTrue(res == 202, "RESULT: " + res);

            //Remove created category
            RemoveCategories();
        }