aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers.Test/ByteStringTest.cs
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-10-04 13:43:26 -0500
committerrogerk <devnull@localhost>2011-10-04 13:43:26 -0500
commiteac64a5f7afdfca32476534fd8d0bf69d77002ca (patch)
tree03a38e9992afd1ffb929f3f830d6054009a9cba2 /src/ProtocolBuffers.Test/ByteStringTest.cs
parent5e48fef659b571db38be18afb61bea0cffcdfdca (diff)
downloadprotobuf-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/ByteStringTest.cs')
-rw-r--r--src/ProtocolBuffers.Test/ByteStringTest.cs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/ProtocolBuffers.Test/ByteStringTest.cs b/src/ProtocolBuffers.Test/ByteStringTest.cs
index 0ba665de..97425fe8 100644
--- a/src/ProtocolBuffers.Test/ByteStringTest.cs
+++ b/src/ProtocolBuffers.Test/ByteStringTest.cs
@@ -35,20 +35,20 @@
#endregion
using System.Text;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class ByteStringTest
{
- [Test]
+ [TestMethod]
public void EmptyByteStringHasZeroSize()
{
Assert.AreEqual(0, ByteString.Empty.Length);
}
- [Test]
+ [TestMethod]
public void CopyFromStringWithExplicitEncoding()
{
ByteString bs = ByteString.CopyFrom("AB", Encoding.Unicode);
@@ -59,19 +59,19 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(0, bs[3]);
}
- [Test]
+ [TestMethod]
public void IsEmptyWhenEmpty()
{
Assert.IsTrue(ByteString.CopyFromUtf8("").IsEmpty);
}
- [Test]
+ [TestMethod]
public void IsEmptyWhenNotEmpty()
{
Assert.IsFalse(ByteString.CopyFromUtf8("X").IsEmpty);
}
- [Test]
+ [TestMethod]
public void CopyFromByteArrayCopiesContents()
{
byte[] data = new byte[1];
@@ -82,19 +82,19 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(10, bs[0]);
}
- [Test]
+ [TestMethod]
public void ToByteArrayCopiesContents()
{
ByteString bs = ByteString.CopyFromUtf8("Hello");
byte[] data = bs.ToByteArray();
- Assert.AreEqual('H', data[0]);
- Assert.AreEqual('H', bs[0]);
+ Assert.AreEqual((byte)'H', data[0]);
+ Assert.AreEqual((byte)'H', bs[0]);
data[0] = 0;
Assert.AreEqual(0, data[0]);
- Assert.AreEqual('H', bs[0]);
+ Assert.AreEqual((byte)'H', bs[0]);
}
- [Test]
+ [TestMethod]
public void CopyFromUtf8UsesUtf8()
{
ByteString bs = ByteString.CopyFromUtf8("\u20ac");
@@ -104,7 +104,7 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(0xac, bs[2]);
}
- [Test]
+ [TestMethod]
public void CopyFromPortion()
{
byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6};
@@ -114,14 +114,14 @@ namespace Google.ProtocolBuffers
Assert.AreEqual(3, bs[1]);
}
- [Test]
+ [TestMethod]
public void ToStringUtf8()
{
ByteString bs = ByteString.CopyFromUtf8("\u20ac");
Assert.AreEqual("\u20ac", bs.ToStringUtf8());
}
- [Test]
+ [TestMethod]
public void ToStringWithExplicitEncoding()
{
ByteString bs = ByteString.CopyFrom("\u20ac", Encoding.Unicode);