Пример #1
0
        public void get_items_any()
        {
            var result = new GoogleKeywordSearch().Search("жалюзи горизонтальные");

            Assert.IsTrue(result.EngineResults.Count > 80);
            Assert.IsTrue(result.EngineResults.Count <= 100);
        }
Пример #2
0
        public void get_date()
        {
            DateTime dt = DateTime.UtcNow;
            var result = new GoogleKeywordSearch().Search("жалюзи");

            Assert.IsTrue((dt - result.Date).TotalSeconds < 5);
        }
Пример #3
0
        public void FindSitePositionByKeyword(string keyword, Engine engine)
        {
            var store = PlatformClient.ConnectToEventStore(Settings.StorePath, Settings.StoreId, Settings.StoreConnection);

            IKeywordSearch keywordSearch = null;

            switch (engine)
            {
                case Engine.Google:
                    keywordSearch = new GoogleKeywordSearch();
                    break;
                case Engine.Yandex:
                    throw new InvalidEnumArgumentException("не реализован");
                case Engine.None:
                default:
                    throw new ArgumentOutOfRangeException("engine");
            }

            var result = keywordSearch.Search(keyword);

            store.WriteEvent("EngineSearchResult", result.ToBinary());
        }
Пример #4
0
        public void get_version()
        {
            var result = new GoogleKeywordSearch().Search("жалюзи");

            Assert.AreEqual("0.0.1", result.Version);
        }
Пример #5
0
        public void get_keyword()
        {
            var result = new GoogleKeywordSearch().Search("жалюзи");

            Assert.AreEqual("жалюзи", result.Keyword);
        }
Пример #6
0
        public void get_engine()
        {
            var result = new GoogleKeywordSearch().Search("жалюзи");

            Assert.AreEqual(Engine.Google, (Engine)result.Engine);
        }