Exemplo n.º 1
0
        public void PushTest()
        {
            IBaiduPushResult result = BaiduUtility.Push("www.beianm.com", "cMsCtRF1P1XullOH", false, new string[] {
                "http://www.beianm.com/b/21/802/XINICPBEI13001563HAO.html",
                "http://www.beianm.com/b/21/802/YUEICPBEI11053162HAO.html",
            });

            Assert.IsNotNull(result);
        }
Exemplo n.º 2
0
        public void BeginPushTest()
        {
            IBaiduPushResult result = null;

            using (AutoResetEvent are = new AutoResetEvent(false)) {
                BaiduUtility.BeginPush("www.beianm.com", "cMsCtRF1P1XullOH", false, new string[] {
                    "http://www.beianm.com/b/21/802/XINICPBEI13003823HAO.html",
                    "http://www.beianm.com/b/21/802/XINICPBEI15000645HAO.html",
                }, (ar) => {
                    try {
                        result = BaiduUtility.EndPush(ar);
                    } finally {
                        are.Set();
                    }
                }, false);
                are.WaitOne();
            }

            Assert.IsNotNull(result);
        }