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/ProtocolBuffersLite.Test/InteropLiteTest.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/ProtocolBuffersLite.Test/InteropLiteTest.cs')
-rw-r--r-- | src/ProtocolBuffersLite.Test/InteropLiteTest.cs | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/ProtocolBuffersLite.Test/InteropLiteTest.cs b/src/ProtocolBuffersLite.Test/InteropLiteTest.cs index c49e0350..37739d2f 100644 --- a/src/ProtocolBuffersLite.Test/InteropLiteTest.cs +++ b/src/ProtocolBuffersLite.Test/InteropLiteTest.cs @@ -38,14 +38,14 @@ using System; using System.Collections.Generic;
using Google.ProtocolBuffers;
using Google.ProtocolBuffers.TestProtos;
-using NUnit.Framework;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers
{
- [TestFixture]
+ [TestClass]
public class InteropLiteTest
{
- [Test]
+ [TestMethod]
public void TestConvertFromFullMinimal()
{
TestInteropPerson person = TestInteropPerson.CreateBuilder()
@@ -56,10 +56,10 @@ namespace Google.ProtocolBuffers TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(person.ToByteArray());
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestConvertFromFullComplete()
{
TestInteropPerson person = TestInteropPerson.CreateBuilder()
@@ -82,10 +82,10 @@ namespace Google.ProtocolBuffers TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(person.ToByteArray(), registry);
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestConvertFromLiteMinimal()
{
TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder()
@@ -96,10 +96,10 @@ namespace Google.ProtocolBuffers TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray());
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
}
- [Test]
+ [TestMethod]
public void TestConvertFromLiteComplete()
{
TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder()
@@ -122,7 +122,7 @@ namespace Google.ProtocolBuffers TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry);
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
}
public ByteString AllBytes
@@ -136,7 +136,7 @@ namespace Google.ProtocolBuffers }
}
- [Test]
+ [TestMethod]
public void TestCompareStringValues()
{
TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder()
@@ -147,7 +147,7 @@ namespace Google.ProtocolBuffers .AddPhone(TestInteropPersonLite.Types.PhoneNumber.CreateBuilder().SetNumber("555-1234").Build())
.AddPhone(
TestInteropPersonLite.Types.PhoneNumber.CreateBuilder().SetNumber(
- System.Text.Encoding.ASCII.GetString(AllBytes.ToByteArray())).Build())
+ System.Text.Encoding.UTF8.GetString(AllBytes.ToByteArray(), 0, AllBytes.Length)).Build())
.AddAddresses(
TestInteropPersonLite.Types.Addresses.CreateBuilder().SetAddress("123 Seseme").SetCity("Wonderland")
.SetState("NA").SetZip(12345).Build())
@@ -161,7 +161,7 @@ namespace Google.ProtocolBuffers TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry);
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
TestInteropPerson.Builder copyBuilder = TestInteropPerson.CreateBuilder();
TextFormat.Merge(
@@ -169,7 +169,7 @@ namespace Google.ProtocolBuffers "[protobuf_unittest_extra.employee_id]"), registry, copyBuilder);
copy = copyBuilder.Build();
- Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
+ TestUtil.AssertBytesEqual(person.ToByteArray(), copy.ToByteArray());
string liteText = person.ToString().TrimEnd().Replace("\r", "");
string fullText = copy.ToString().TrimEnd().Replace("\r", "");
|