Commit 835fb947 authored by Jos Hickson's avatar Jos Hickson

Fixed parsing of BoolValue.

parent 2b22b611
......@@ -417,5 +417,12 @@ namespace Google.Protobuf.WellKnownTypes
TestWellKnownTypes.Descriptor.Fields[TestWellKnownTypes.StringFieldFieldNumber].Accessor.Clear(message);
Assert.IsNull(message.StringField);
}
[Test]
public void GivenBoolValueWhenPerformingRoundTripEncodingViaJsonThenShouldNotExpectObjectAtTopLevel()
{
var value = new BoolValue { Value = true };
Assert.AreEqual(value, JsonParser.Default.Parse<BoolValue>(JsonFormatter.Default.Format(value)));
}
}
}
......@@ -86,7 +86,8 @@ namespace Google.Protobuf
{ FloatValue.Descriptor.FullName, MergeWrapperField },
{ DoubleValue.Descriptor.FullName, MergeWrapperField },
{ BytesValue.Descriptor.FullName, MergeWrapperField },
{ StringValue.Descriptor.FullName, MergeWrapperField }
{ StringValue.Descriptor.FullName, MergeWrapperField },
{ BoolValue.Descriptor.FullName, MergeWrapperField }
};
// Convenience method to avoid having to repeat the same code multiple times in the above
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment