Esempio n. 1
0
        public void TestInternetSearching()
        {
            SearchEngineFactory factory = new InternetSearchEngineFactory();
            SearchEngine        engine  = factory.CreateSearchEngine();
            SearchEngine        engine1 = factory.CreateSearchEngine();

            Assert.IsNotNull(engine);
            Assert.IsNotNull(engine1);
            Assert.AreEqual(engine, engine1);

            SearchResult result1 = new SearchResult();
            SearchResult result2 = new SearchResult();

            Assert.IsNotNull(result1);
            Assert.IsNotNull(result2);
            result1 = engine.ExactSearch(m_control.Categories);
            result2 = engine.BlurSearch(m_control.Categories);

            Assert.AreEqual("contents", result1.Content);
            Assert.AreEqual("more contents", result2.Content);
        }