diff options
Diffstat (limited to 'csharp/ProtocolBuffers.Test/Collections/PopsicleListTest.cs')
-rw-r--r-- | csharp/ProtocolBuffers.Test/Collections/PopsicleListTest.cs | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/csharp/ProtocolBuffers.Test/Collections/PopsicleListTest.cs b/csharp/ProtocolBuffers.Test/Collections/PopsicleListTest.cs deleted file mode 100644 index 6943672d..00000000 --- a/csharp/ProtocolBuffers.Test/Collections/PopsicleListTest.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; - -namespace Google.ProtocolBuffers.Collections { - [TestFixture] - public class PopsicleListTest { - - [Test] - public void MutatingOperationsOnFrozenList() { - PopsicleList<string> list = new PopsicleList<string>(); - list.MakeReadOnly(); - AssertNotSupported(() => list.Add("")); - AssertNotSupported(() => list.Clear()); - AssertNotSupported(() => list.Insert(0, "")); - AssertNotSupported(() => list.Remove("")); - AssertNotSupported(() => list.RemoveAt(0)); - } - - [Test] - public void NonMutatingOperationsOnFrozenList() { - PopsicleList<string> list = new PopsicleList<string>(); - list.MakeReadOnly(); - Assert.IsFalse(list.Contains("")); - Assert.AreEqual(0, list.Count); - list.CopyTo(new string[5], 0); - list.GetEnumerator(); - Assert.AreEqual(-1, list.IndexOf("")); - Assert.IsTrue(list.IsReadOnly); - } - - [Test] - public void MutatingOperationsOnFluidList() { - PopsicleList<string> list = new PopsicleList<string>(); - list.Add(""); - list.Clear(); - list.Insert(0, ""); - list.Remove(""); - list.Add("x"); // Just to make the next call valid - list.RemoveAt(0); - } - - [Test] - public void NonMutatingOperationsOnFluidList() { - PopsicleList<string> list = new PopsicleList<string>(); - Assert.IsFalse(list.Contains("")); - Assert.AreEqual(0, list.Count); - list.CopyTo(new string[5], 0); - list.GetEnumerator(); - Assert.AreEqual(-1, list.IndexOf("")); - Assert.IsFalse(list.IsReadOnly); - } - - private static void AssertNotSupported(Action action) { - try { - action(); - Assert.Fail("Expected NotSupportedException"); - } catch (NotSupportedException) { - // Expected - } - } - } -} |