public void CanReadNumberValue(string data, decimal value) { using (TextReader stream = new StringReader(data)) { JsonReader reader = new JsonReader(stream); while (reader.Next()) { Assert.Equal(value, Decimal.Parse(reader.Token.GetString(), NumberStyles.Float, CultureInfo.InvariantCulture)); } } }
public void CanReadTextValue(string data, string value) { using (TextReader stream = new StringReader(data)) { JsonReader reader = new JsonReader(stream); while (reader.Next()) { Assert.Equal(value, reader.Token.GetString()); } } }
public void CanReadData(string data) { using (TextReader stream = new StringReader(data)) { JsonReader reader = new JsonReader(stream); while (reader.Next()) { Assert.False(reader.HasError); } Assert.False(reader.HasError); } }
public void CanHandleStreamError(string data) { using (TextReader stream = new StringReader(data)) { JsonReader reader = new JsonReader(stream); while (reader.Next()) { } Assert.True(reader.HasError); } }