Commit 1a0ff955 authored by Sydney Acksman's avatar Sydney Acksman

Add comment and Assert.DoesNotThrow to RequiredFieldsNoThrow

parent f084d622
......@@ -261,11 +261,14 @@ namespace Google.Protobuf
Assert.True(message.IsInitialized());
}
// Code was accidentally left in message parser that threw exceptions when missing required fields after parsing.
// We've decided to not throw exceptions on missing fields, instead leaving it up to the consumer how they
// want to check and handle missing fields.
[Test]
public void RequiredFieldsNoThrow()
{
TestRequired.Parser.ParseFrom(new byte[0]);
(TestRequired.Parser as MessageParser).ParseFrom(new byte[0]);
Assert.DoesNotThrow(() => TestRequired.Parser.ParseFrom(new byte[0]));
Assert.DoesNotThrow(() => (TestRequired.Parser as MessageParser).ParseFrom(new byte[0]));
}
[Test]
......
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