• Home
  • Raw
  • Download

Lines Matching refs:json

70             var json = "{ \"mapInt32Int32\": { \"" + keyText + "\" : \"1\" } }";  in IntegerMapKeysAreStrict()
71 … Assert.Throws<InvalidProtocolBufferException>(() => JsonParser.Default.Parse<TestMap>(json)); in IntegerMapKeysAreStrict()
77 var json = "{ \"single_int32\": 10 }"; in OriginalFieldNameAccepted()
79 Assert.AreEqual(expected, TestAllTypes.Parser.ParseJson(json)); in OriginalFieldNameAccepted()
130 var json = new JsonFormatter(new JsonFormatter.Settings(true)).Format(message); in SingularWrappers_ExplicitNulls()
131 var parsed = JsonParser.Default.Parse<TestWellKnownTypes>(json); in SingularWrappers_ExplicitNulls()
143 public void Wrappers_Standalone(System.Type wrapperType, string json, object expectedValue) in Wrappers_Standalone() argument
150 JsonParser.Default.Merge(parsed, json); in Wrappers_Standalone()
158 string json = "{\"valueField\": null}"; in ExplicitNullValue()
159 var message = JsonParser.Default.Parse<TestWellKnownTypes>(json); in ExplicitNullValue()
194 string json = "{ \"repeated_foreign_message\": [null] }"; in RepeatedField_NullElementProhibited()
195 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in RepeatedField_NullElementProhibited()
201 string json = "{ \"repeated_foreign_message\": null }"; in RepeatedField_NullOverallValueAllowed()
202 Assert.AreEqual(new TestAllTypes(), TestAllTypes.Parser.ParseJson(json)); in RepeatedField_NullOverallValueAllowed()
209 public void MapField_NullValueProhibited(string json) in MapField_NullValueProhibited() argument
211 Assert.Throws<InvalidProtocolBufferException>(() => TestMap.Parser.ParseJson(json)); in MapField_NullValueProhibited()
217 string json = "{ \"mapInt32Int32\": null }"; in MapField_NullOverallValueAllowed()
218 Assert.AreEqual(new TestMap(), TestMap.Parser.ParseJson(json)); in MapField_NullOverallValueAllowed()
233 var json = JsonFormatter.Default.Format(message);
234 var parsed = JsonParser.Default.Parse<T>(json);
247 string json = "{ \"singleInt32\": \"" + jsonValue + "\"}"; in StringToInt32_Valid()
248 var parsed = TestAllTypes.Parser.ParseJson(json); in StringToInt32_Valid()
266 string json = "{ \"singleInt32\": \"" + jsonValue + "\"}"; in StringToInt32_Invalid()
267 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in StringToInt32_Invalid()
276 string json = "{ \"singleUint32\": \"" + jsonValue + "\"}"; in StringToUInt32_Valid()
277 var parsed = TestAllTypes.Parser.ParseJson(json); in StringToUInt32_Valid()
287 string json = "{ \"singleUint32\": \"" + jsonValue + "\"}"; in StringToUInt32_Invalid()
288 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in StringToUInt32_Invalid()
299 string json = "{ \"singleInt64\": \"" + jsonValue + "\"}"; in StringToInt64_Valid()
300 var parsed = TestAllTypes.Parser.ParseJson(json); in StringToInt64_Valid()
310 string json = "{ \"singleInt64\": \"" + jsonValue + "\"}"; in StringToInt64_Invalid()
311 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in StringToInt64_Invalid()
320 string json = "{ \"singleUint64\": \"" + jsonValue + "\"}"; in StringToUInt64_Valid()
321 var parsed = TestAllTypes.Parser.ParseJson(json); in StringToUInt64_Valid()
331 string json = "{ \"singleUint64\": \"" + jsonValue + "\"}"; in StringToUInt64_Invalid()
332 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in StringToUInt64_Invalid()
356 string json = "{ \"singleDouble\": \"" + jsonValue + "\"}"; in StringToDouble_Valid()
357 var parsed = TestAllTypes.Parser.ParseJson(json); in StringToDouble_Valid()
384 string json = "{ \"singleDouble\": \"" + jsonValue + "\"}"; in StringToDouble_Invalid()
385 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in StringToDouble_Invalid()
399 string json = "{ \"singleFloat\": \"" + jsonValue + "\"}"; in StringToFloat_Valid()
400 var parsed = TestAllTypes.Parser.ParseJson(json); in StringToFloat_Valid()
414 string json = "{ \"singleFloat\": \"" + jsonValue + "\"}"; in StringToFloat_Invalid()
415 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in StringToFloat_Invalid()
431 string json = "{ \"singleInt32\": " + jsonValue + "}"; in NumberToInt32_Valid()
432 var parsed = TestAllTypes.Parser.ParseJson(json); in NumberToInt32_Valid()
449 string json = "{ \"singleInt32\": " + jsonValue + "}"; in NumberToInt32_Invalid()
450 Assert.Throws(expectedExceptionType, () => TestAllTypes.Parser.ParseJson(json)); in NumberToInt32_Invalid()
459 string json = "{ \"singleUint32\": " + jsonValue + "}"; in NumberToUInt32_Valid()
460 var parsed = TestAllTypes.Parser.ParseJson(json); in NumberToUInt32_Valid()
470 string json = "{ \"singleUint32\": " + jsonValue + "}"; in NumberToUInt32_Invalid()
471 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in NumberToUInt32_Invalid()
484 string json = "{ \"singleInt64\": " + jsonValue + "}"; in NumberToInt64_Valid()
485 var parsed = TestAllTypes.Parser.ParseJson(json); in NumberToInt64_Valid()
498 string json = "{ \"singleInt64\": " + jsonValue + "}"; in NumberToInt64_Invalid()
499 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in NumberToInt64_Invalid()
510 string json = "{ \"singleUint64\": " + jsonValue + "}"; in NumberToUInt64_Valid()
511 var parsed = TestAllTypes.Parser.ParseJson(json); in NumberToUInt64_Valid()
521 string json = "{ \"singleUint64\": " + jsonValue + "}"; in NumberToUInt64_Invalid()
522 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in NumberToUInt64_Invalid()
543 string json = "{ \"singleDouble\": " + jsonValue + "}"; in NumberToDouble_Valid()
544 var parsed = TestAllTypes.Parser.ParseJson(json); in NumberToDouble_Valid()
560 string json = "{ \"singleDouble\": " + jsonValue + "}"; in NumberToDouble_Invalid()
561 Assert.Throws<InvalidJsonException>(() => TestAllTypes.Parser.ParseJson(json)); in NumberToDouble_Invalid()
575 string json = "{ \"singleFloat\": " + jsonValue + "}"; in NumberToFloat_Valid()
576 var parsed = TestAllTypes.Parser.ParseJson(json); in NumberToFloat_Valid()
590 string json = "{ \"singleFloat\": " + jsonValue + "}"; in NumberToFloat_Invalid()
591 Assert.Throws(expectedExceptionType, () => TestAllTypes.Parser.ParseJson(json)); in NumberToFloat_Invalid()
639 string json = WrapInQuotes(jsonValue); in Timestamp_Valid()
640 var parsed = Timestamp.Parser.ParseJson(json); in Timestamp_Valid()
666 string json = WrapInQuotes(jsonValue); in Timestamp_Invalid()
667 Assert.Throws<InvalidProtocolBufferException>(() => Timestamp.Parser.ParseJson(json)); in Timestamp_Invalid()
740 string json = WrapInQuotes(jsonValue); in Duration_Valid()
741 var parsed = Duration.Parser.ParseJson(json); in Duration_Valid()
770 string json = WrapInQuotes(jsonValue); in Duration_Invalid()
771 Assert.Throws<InvalidProtocolBufferException>(() => Duration.Parser.ParseJson(json)); in Duration_Invalid()
786 string json = WrapInQuotes(jsonValue); in FieldMask_Valid()
787 var parsed = FieldMask.Parser.ParseJson(json); in FieldMask_Valid()
795 string json = WrapInQuotes(jsonValue); in FieldMask_Invalid()
796 Assert.Throws<InvalidProtocolBufferException>(() => FieldMask.Parser.ParseJson(json)); in FieldMask_Invalid()
806 var json = formatter.Format(original); // This is tested in JsonFormatterTest in Any_RegularMessage()
808 Assert.AreEqual(original, parser.Parse<Any>(json)); in Any_RegularMessage()
820 …string json = "{ \"@type\": \"custom.prefix/middle-part/protobuf_unittest.TestAllTypes\", \"single… in Any_CustomPrefix()
821 Assert.AreEqual(original, parser.Parse<Any>(json)); in Any_CustomPrefix()
827 string json = "{ \"@type\": \"type.googleapis.com/bogus\" }"; in Any_UnknownType()
828 Assert.Throws<InvalidOperationException>(() => Any.Parser.ParseJson(json)); in Any_UnknownType()
834 string json = "{ \"foo\": \"bar\" }"; in Any_NoTypeUrl()
835 Assert.Throws<InvalidProtocolBufferException>(() => Any.Parser.ParseJson(json)); in Any_NoTypeUrl()
845 var json = formatter.Format(original); // This is tested in JsonFormatterTest in Any_WellKnownType()
847 Assert.AreEqual(original, parser.Parse<Any>(json)); in Any_WellKnownType()
861 var json = formatter.Format(message); in Any_Nested()
863 Assert.AreEqual(message, parser.Parse(json, TestWellKnownTypes.Descriptor)); in Any_Nested()
869 string json = "{} 10"; in DataAfterObject()
870 Assert.Throws<InvalidJsonException>(() => TestAllTypes.Parser.ParseJson(json)); in DataAfterObject()
895 string json = "{ \"singleBytes\": \"" + badBase64 + "\" }"; in Bytes_InvalidBase64()
896 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in Bytes_InvalidBase64()
905 string json = "{ \"singleForeignEnum\": " + value + " }"; in EnumValid()
906 var parsed = TestAllTypes.Parser.ParseJson(json); in EnumValid()
915 string json = "{ \"singleForeignEnum\": " + value + " }"; in Enum_Invalid()
916 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in Enum_Invalid()
922 string json = "{ \"oneofString\": \"x\", \"oneofUint32\": 10 }"; in OneofDuplicate_Invalid()
923 … Assert.Throws<InvalidProtocolBufferException>(() => TestAllTypes.Parser.ParseJson(json)); in OneofDuplicate_Invalid()