当前位置: 首页>>代码示例>>C#>>正文


C# JsonReader.ReadNext方法代码示例

本文整理汇总了C#中JsonReader.ReadNext方法的典型用法代码示例。如果您正苦于以下问题:C# JsonReader.ReadNext方法的具体用法?C# JsonReader.ReadNext怎么用?C# JsonReader.ReadNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JsonReader的用法示例。


在下文中一共展示了JsonReader.ReadNext方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ReadsEscapedControlCharacters

 public void ReadsEscapedControlCharacters()
 {
     var sr = new StringReader("\"this is escaped: \\b\\f\\n\\r\\t\\x17\"");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.String, reader.Token);
     Assert.AreEqual("\"this is escaped: \\b\\f\\n\\r\\t\\x17\"", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Strings.cs

示例2: ReadsEscapedUnicodeCharacters

 public void ReadsEscapedUnicodeCharacters()
 {
     var sr = new StringReader("\"this is escaped: \\u3034\"");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.String, reader.Token);
     Assert.AreEqual("\"this is escaped: \\u3034\"", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Strings.cs

示例3: ReadsNonEscapedString

 public void ReadsNonEscapedString()
 {
     var sr = new StringReader("\"hello, world\"");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.String, reader.Token);
     Assert.AreEqual("\"hello, world\"", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Strings.cs

示例4: ReadsEscapedQuoteString

 public void ReadsEscapedQuoteString()
 {
     var sr = new StringReader("\"this is escaped: \\\"\"");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.String, reader.Token);
     Assert.AreEqual("\"this is escaped: \\\"\"", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Strings.cs

示例5: ReadsSimpleReal

 public void ReadsSimpleReal()
 {
     var sr = new StringReader("123.0");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.Real, reader.Token);
     Assert.AreEqual("123.0", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Reals.cs

示例6: ReadsExponentialNegativeReal

 public void ReadsExponentialNegativeReal()
 {
     var sr = new StringReader("-123.0e1");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.Real, reader.Token);
     Assert.AreEqual("-123.0e1", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Reals.cs

示例7: ReadsArrayEnd

 public void ReadsArrayEnd()
 {
     var sr = new StringReader("]");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.ArrayEnd, reader.Token);
     Assert.AreEqual("]", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Symbols.cs

示例8: ReadsColon

 public void ReadsColon()
 {
     var sr = new StringReader(":");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.Colon, reader.Token);
     Assert.AreEqual(":", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Symbols.cs

示例9: ReadsObjectStart

 public void ReadsObjectStart()
 {
     var sr = new StringReader("{");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.ObjectStart, reader.Token);
     Assert.AreEqual("{", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Symbols.cs

示例10: ReadsNegativeInteger

 public void ReadsNegativeInteger()
 {
     var sr = new StringReader("-123");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.Integer, reader.Token);
     Assert.AreEqual("-123", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Integers.cs

示例11: ReadsIdentifier

 public void ReadsIdentifier()
 {
     var sr = new StringReader("Date");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.Identifier, reader.Token);
     Assert.AreEqual("Date", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Keywords.cs

示例12: ReadsFalse

 public void ReadsFalse()
 {
     var sr = new StringReader("false");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.False, reader.Token);
     Assert.AreEqual("false", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Keywords.cs

示例13: ReadsNew

 public void ReadsNew()
 {
     var sr = new StringReader("new Date()");
     var reader = new JsonReader(sr);
     Assert.IsTrue(reader.ReadNext(), "Failed read");
     Assert.AreEqual(JsonTokenType.New, reader.Token);
     Assert.AreEqual("new", reader.Text);
 }
开发者ID:ALyman,项目名称:Liquid.Json,代码行数:8,代码来源:Keywords.cs


注:本文中的JsonReader.ReadNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。