Commit 3b625064 authored by csharptest's avatar csharptest Committed by rogerk

One more test to ensure DefaultInstance is read-only

parent 2a1f0bd4
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using Google.ProtocolBuffers.Collections;
using NUnit.Framework; using NUnit.Framework;
using Google.ProtocolBuffers.TestProtos; using Google.ProtocolBuffers.TestProtos;
using Google.ProtocolBuffers.Serialization; using Google.ProtocolBuffers.Serialization;
...@@ -10,6 +11,15 @@ namespace Google.ProtocolBuffers ...@@ -10,6 +11,15 @@ namespace Google.ProtocolBuffers
[TestFixture] [TestFixture]
public class ReusableBuilderTest public class ReusableBuilderTest
{ {
[Test]
public void TestModifyDefaultInstance()
{
//verify that the default instance has correctly been marked as read-only
Assert.AreEqual(typeof(PopsicleList<bool>), TestAllTypes.DefaultInstance.RepeatedBoolList.GetType());
PopsicleList<bool> list = (PopsicleList<bool>)TestAllTypes.DefaultInstance.RepeatedBoolList;
Assert.IsTrue(list.IsReadOnly);
}
[Test] [Test]
public void TestUnmodifiedDefaultInstance() public void TestUnmodifiedDefaultInstance()
{ {
......
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