public void MeteorJsonDecodeTest() { try { foreach (var elements in TweetSamples.GetStreamSampleElements()) { // Trace.WriteLine(MeteorJson.Parse(elements).ToString()); Debug.WriteLine("{0}", MeteorJson.Parse(elements).ToString()); Debug.WriteLine("{0}", SafeMeteorJson.Parse(elements).ToString()); } } catch (JsonParseException ex) { Debug.WriteLine(ex.ToString()); throw; } }
public void SafeMeteorJsonPerformanceTest() { var cs = ""; for (int i = 0; i < LoopCount; i++) { foreach (var elements in TweetSamples.GetStreamSampleElements()) { var parsed = SafeMeteorJson.Parse(elements); if (parsed.ContainsKey("text") && parsed.ContainsKey("user") && parsed["user"].ContainsKey("screen_name")) { cs = "@" + parsed["user"]["screen_name"].AsString() + ": " + parsed["text"].AsString(); } } } // Trace.WriteLine(cs); }