Browse Source

Add test for not throwing on missing required

Sydney Acksman 5 years ago
parent
commit
f084d622c2
1 changed files with 7 additions and 0 deletions
  1. 7 0
      csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs

+ 7 - 0
csharp/src/Google.Protobuf.Test/GeneratedMessageTest.Proto2.cs

@@ -261,6 +261,13 @@ namespace Google.Protobuf
             Assert.True(message.IsInitialized());
         }
 
+        [Test]
+        public void RequiredFieldsNoThrow()
+        {
+            TestRequired.Parser.ParseFrom(new byte[0]);
+            (TestRequired.Parser as MessageParser).ParseFrom(new byte[0]);
+        }
+
         [Test]
         public void RequiredFieldsInExtensions()
         {