예제 #1
0
        public static void TestParseEmptyAddress()
        {
            SimpleBuffer buffer = new SimpleBuffer();

            buffer.appendAscii(" { }");

            JsonPublishableParser parser = new JsonPublishableParser(buffer.getReadIterator());

            UInt64[] addr = null;
            Assert.False(parser.parseAddress(ref addr));
        }
예제 #2
0
        public static void TestParseFail(String asText)
        {
            SimpleBuffer buffer = new SimpleBuffer();

            buffer.appendAscii(asText);

            JsonPublishableParser parser = new JsonPublishableParser(buffer.getReadIterator());

            UInt64[] addr = null;
            Assert.Throws <Exception>(() => { parser.parseAddress(ref addr); });
        }
예제 #3
0
        public static void TestParseAddress(String asText, UInt64[] parsed)
        {
            SimpleBuffer buffer = new SimpleBuffer();

            buffer.appendAscii(asText);

            JsonPublishableParser parser = new JsonPublishableParser(buffer.getReadIterator());

            UInt64[] addr = null;
            Assert.True(parser.parseAddress(ref addr));
            Assert.AreEqual(parsed, addr);
        }