예제 #1
0
        void TestFailConsumeObject(String json)
        {
            JsonByteArrayConsumer consumer = new JsonByteArrayConsumer(Encoding.UTF8.GetBytes(json));

            try
            {
                consumer.ConsumeObject(0);
                Assert.Fail(String.Format("Expected exception but did not get one for text '{0}'", json));
            }
            catch (JsonException e)
            {
                Console.WriteLine("[Test-Error] '{0}' threw {1}", json, e.Message);
            }
        }
예제 #2
0
        void TestConsumeObject(String json)
        {
            JsonByteArrayConsumer consumer = new JsonByteArrayConsumer(Encoding.UTF8.GetBytes(json));

            Assert.AreEqual((UInt32)json.Length, consumer.ConsumeObject(0));
        }