diff options
author | Jon Skeet <skeet@pobox.com> | 2015-07-30 09:47:38 +0100 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2015-07-30 09:47:38 +0100 |
commit | 7a0effb9e956ee5509d99a33f7d8fb52a9636871 (patch) | |
tree | 8bae164441950d8792d1b1612596809e45e9ce82 /csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs | |
parent | 9cfea1d6f6b81462021b928f45c732cd9920d869 (diff) | |
parent | 7ec023acf4019e5401d4e147204ba5de12eed226 (diff) | |
download | protobuf-7a0effb9e956ee5509d99a33f7d8fb52a9636871.tar.gz protobuf-7a0effb9e956ee5509d99a33f7d8fb52a9636871.tar.bz2 protobuf-7a0effb9e956ee5509d99a33f7d8fb52a9636871.zip |
Merge pull request #654 from jtattermusch/csharp_hide_freeze
Remove the C# Freeze API
Diffstat (limited to 'csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs')
-rw-r--r-- | csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs b/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs index 25be7731..33c4e10c 100644 --- a/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs +++ b/csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs @@ -194,43 +194,9 @@ namespace Google.Protobuf.Collections } [Test] - public void Freeze_FreezesElements() - { - var list = new RepeatedField<TestAllTypes> { new TestAllTypes() }; - Assert.IsFalse(list[0].IsFrozen); - list.Freeze(); - Assert.IsTrue(list[0].IsFrozen); - } - - [Test] - public void Freeze_PreventsMutations() - { - var list = new RepeatedField<int> { 0 }; - list.Freeze(); - Assert.Throws<InvalidOperationException>(() => list.Add(1)); - Assert.Throws<InvalidOperationException>(() => list[0] = 1); - Assert.Throws<InvalidOperationException>(() => list.Clear()); - Assert.Throws<InvalidOperationException>(() => list.RemoveAt(0)); - Assert.Throws<InvalidOperationException>(() => list.Remove(0)); - Assert.Throws<InvalidOperationException>(() => list.Insert(0, 0)); - } - - [Test] - public void Freeze_ReportsFrozen() - { - var list = new RepeatedField<int> { 0 }; - Assert.IsFalse(list.IsFrozen); - Assert.IsFalse(list.IsReadOnly); - list.Freeze(); - Assert.IsTrue(list.IsFrozen); - Assert.IsTrue(list.IsReadOnly); - } - - [Test] public void Clone_ReturnsMutable() { var list = new RepeatedField<int> { 0 }; - list.Freeze(); var clone = list.Clone(); clone[0] = 1; } @@ -585,8 +551,6 @@ namespace Google.Protobuf.Collections var field = new RepeatedField<string> { "first", "second" }; IList list = field; Assert.IsFalse(list.IsFixedSize); - field.Freeze(); - Assert.IsTrue(list.IsFixedSize); } [Test] |