|
|
@ -695,6 +695,22 @@ namespace Google.Protobuf |
|
|
|
Assert.AreEqual(Value.ForList(Value.ForNumber(1), Value.ForString("x")), Value.Parser.ParseJson("[1, \"x\"]")); |
|
|
|
Assert.AreEqual(Value.ForList(Value.ForNumber(1), Value.ForString("x")), Value.Parser.ParseJson("[1, \"x\"]")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void Value_List_WithNullElement() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var expected = Value.ForList(Value.ForString("x"), Value.ForNull(), Value.ForString("y")); |
|
|
|
|
|
|
|
var actual = Value.Parser.ParseJson("[\"x\", null, \"y\"]"); |
|
|
|
|
|
|
|
Assert.AreEqual(expected, actual); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
|
|
|
public void StructValue_NullElement() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var expected = Value.ForStruct(new Struct { Fields = { { "x", Value.ForNull() } } }); |
|
|
|
|
|
|
|
var actual = Value.Parser.ParseJson("{ \"x\": null }"); |
|
|
|
|
|
|
|
Assert.AreEqual(expected, actual); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
[Test] |
|
|
|
public void ParseListValue() |
|
|
|
public void ParseListValue() |
|
|
|
{ |
|
|
|
{ |
|
|
|