Ejemplo n.º 1
0
        public BaiduAppDetail GetAppDetail(long appId)
        {
            _content.AppId = appId;
            var ret = _content.GetData(null);

            var appXml = _service.GetXmlDocument(ret);

            var appResult = _service.Deserialize <BaiduContentResult>(appXml);

            var app = appResult.Result.AppDetail;

            return(app);
        }
Ejemplo n.º 2
0
        public void GetXmlDocumentTest()
        {
            var doc = _service.GetXmlDocument(MockBoardListResponse());

            var model = _service.Deserialize <BaiduBoardListResult>(doc);

            Assert.Equal(0, model.StatusCode);
            Assert.Equal(6, model.BoardList.Count);
            Assert.NotEqual(true, string.IsNullOrEmpty(model.BoardList[0].Id.ToString()));

            var doc_app = _service.GetXmlDocument(MockAppResponse());

            var model2 = _service.Deserialize <BaiduBoardResult>(doc_app);

            Assert.Equal(0, model2.StatusCode);
            Assert.Equal(3, model2.Result.AppList.Count);
            Assert.NotEqual(true, string.IsNullOrEmpty(model2.Result.AppList[0].Name));
        }