瀏覽代碼

Make the map test actually test the code...

Jon Skeet 10 年之前
父節點
當前提交
3da90e9f54
共有 1 個文件被更改,包括 7 次插入0 次删除
  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 } },
                 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]