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)); }
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); }); }
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); }