diff options
author | csharptest <roger@csharptest.net> | 2011-10-04 13:43:26 -0500 |
---|---|---|
committer | rogerk <devnull@localhost> | 2011-10-04 13:43:26 -0500 |
commit | eac64a5f7afdfca32476534fd8d0bf69d77002ca (patch) | |
tree | 03a38e9992afd1ffb929f3f830d6054009a9cba2 /src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs | |
parent | 5e48fef659b571db38be18afb61bea0cffcdfdca (diff) | |
download | protobuf-eac64a5f7afdfca32476534fd8d0bf69d77002ca.tar.gz protobuf-eac64a5f7afdfca32476534fd8d0bf69d77002ca.tar.bz2 protobuf-eac64a5f7afdfca32476534fd8d0bf69d77002ca.zip |
- Upgraded NUnit
- Added StatLight and Silverlight unit testing
- Added copies of all projects for Silverlight
- Integrated Silverlight unit tests in build
Diffstat (limited to 'src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs')
-rw-r--r-- | src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs | 48 |
1 files changed, 16 insertions, 32 deletions
diff --git a/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs b/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs index 35b13a1d..0bce60d9 100644 --- a/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs +++ b/src/ProtocolBuffers.Test/Collections/PopsicleListTest.cs @@ -36,29 +36,27 @@ using System;
using System.Collections.Generic;
-using NUnit.Framework;
-
-internal delegate void Action();
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers.Collections
{
- [TestFixture]
+ [TestClass]
public class PopsicleListTest
{
- [Test]
+ [TestMethod]
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));
- AssertNotSupported(() => list.Add(new[] {"", ""}));
+ TestUtil.AssertNotSupported(() => list.Add(""));
+ TestUtil.AssertNotSupported(() => list.Clear());
+ TestUtil.AssertNotSupported(() => list.Insert(0, ""));
+ TestUtil.AssertNotSupported(() => list.Remove(""));
+ TestUtil.AssertNotSupported(() => list.RemoveAt(0));
+ TestUtil.AssertNotSupported(() => list.Add(new[] { "", "" }));
}
- [Test]
+ [TestMethod]
public void NonMutatingOperationsOnFrozenList()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -71,7 +69,7 @@ namespace Google.ProtocolBuffers.Collections Assert.IsTrue(list.IsReadOnly);
}
- [Test]
+ [TestMethod]
public void MutatingOperationsOnFluidList()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -83,7 +81,7 @@ namespace Google.ProtocolBuffers.Collections list.RemoveAt(0);
}
- [Test]
+ [TestMethod]
public void NonMutatingOperationsOnFluidList()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -95,7 +93,7 @@ namespace Google.ProtocolBuffers.Collections Assert.IsFalse(list.IsReadOnly);
}
- [Test]
+ [TestMethod]
public void DoesNotAddNullEnumerable()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -109,7 +107,7 @@ namespace Google.ProtocolBuffers.Collections Assert.Fail("List should not allow nulls.");
}
- [Test]
+ [TestMethod]
public void DoesNotAddRangeWithNull()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -123,7 +121,7 @@ namespace Google.ProtocolBuffers.Collections Assert.Fail("List should not allow nulls.");
}
- [Test]
+ [TestMethod]
public void DoesNotAddNull()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -137,7 +135,7 @@ namespace Google.ProtocolBuffers.Collections Assert.Fail("List should not allow nulls.");
}
- [Test]
+ [TestMethod]
public void DoesNotSetNull()
{
PopsicleList<string> list = new PopsicleList<string>();
@@ -151,19 +149,5 @@ namespace Google.ProtocolBuffers.Collections Assert.Fail("List should not allow nulls.");
}
-
-
- private static void AssertNotSupported(Action action)
- {
- try
- {
- action();
- Assert.Fail("Expected NotSupportedException");
- }
- catch (NotSupportedException)
- {
- // Expected
- }
- }
}
}
\ No newline at end of file |