예제 #1
0
 public string ConvertUri(string uri, string rootName, out string json)
 {
     using(var client = new WebClient())
     {
         json = client.DownloadString(uri);
     }
     _crawler = new JsonDataCrawler(JsonMapper.ToObject(json), rootName);
     return HttpUtility.HtmlEncode(_crawler.Crawl().ToString());
 }
예제 #2
0
 public void Match_Similar_Class_Signatures()
 {
     var user = SetupData();
     var json = JsonConvert.SerializeObject(user);
     var deserializedData = JsonMapper.ToObject(json);
     var crawler = new JsonDataCrawler(deserializedData, "User");
     var signatures = crawler.Crawl();
     Assert.AreEqual(signatures.Count, 3);
     Debug.Write(signatures.ToString());
 }
예제 #3
0
 public void Can_Convert_Youtube_JSON_To_POCOs()
 {
     var crawler = new JsonDataCrawler(JsonMapper.ToObject(YoutubeJSON), "YoutubeApi");
     var code = crawler.Crawl();
     Debug.Write(code);
 }
예제 #4
0
 public void Can_Convert_Twitter_JSON_To_POCOs()
 {
     var crawler = new JsonDataCrawler(JsonMapper.ToObject(TwitterSearchJSON), "Search");
     var code = crawler.Crawl();
     Debug.Write(code);
 }
예제 #5
0
 public void Can_Convert_Facebook_Wall_JSON_To_POCOs()
 {
     var crawler = new JsonDataCrawler(JsonMapper.ToObject(FacebookWallJSON), "Wall");
     var code = crawler.Crawl();
     Debug.Write(code);
 }
예제 #6
0
 public string Convert(string json, string rootName)
 {
     _crawler = new JsonDataCrawler(JsonMapper.ToObject(json), rootName);
     return HttpUtility.HtmlEncode(_crawler.Crawl().ToString());
 }