Browse Source

Make the map test actually test the code...

Jon Skeet 10 years ago
parent
commit
3da90e9f54
1 changed files with 7 additions and 0 deletions
  1. 7 0
      csharp/src/ProtocolBuffers.Test/WellKnownTypes/WrappersTest.cs

+ 7 - 0
csharp/src/ProtocolBuffers.Test/WellKnownTypes/WrappersTest.cs

@@ -167,6 +167,13 @@ namespace Google.Protobuf.WellKnownTypes
                 Uint32Field = { { 15, uint.MaxValue }, { 16, uint.MinValue }, { 17, 0U } },
                 Uint32Field = { { 15, uint.MaxValue }, { 16, uint.MinValue }, { 17, 0U } },
                 Uint64Field = { { 18, ulong.MaxValue }, { 19, ulong.MinValue }, { 20, 0UL } },
                 Uint64Field = { { 18, ulong.MaxValue }, { 19, ulong.MinValue }, { 20, 0UL } },
             };
             };
+
+            var bytes = message.ToByteArray();
+            var parsed = MapWellKnownTypes.Parser.ParseFrom(bytes);
+
+            Assert.AreEqual(message, parsed);
+            // Just to test a single value for sanity...
+            Assert.AreEqual("Second", message.StringField[12]);
         }
         }
 
 
         [Test]
         [Test]