aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2015-05-12 09:47:19 +0100
committerJon Skeet <jonskeet@google.com>2015-05-12 09:48:02 +0100
commit90c8932fc7316b5afaae350395624b6fd2e73a97 (patch)
tree080924d0a9fd8f52d88b1ee4fb76f9aa3bd802cd /csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs
parentc58b2c66448f83c25da0251fe6cf5b12299fa581 (diff)
downloadprotobuf-90c8932fc7316b5afaae350395624b6fd2e73a97.tar.gz
protobuf-90c8932fc7316b5afaae350395624b6fd2e73a97.tar.bz2
protobuf-90c8932fc7316b5afaae350395624b6fd2e73a97.zip
Convert back to using NUnit, which is now loaded via NuGet.
This includes the NUnit test adapter which allows NUnit tests to be run under VS without any extra plugins. Unfortunate the compatibility tests using the abstract test fixture class show up as "external" tests, and aren't well presented - but they do run.
Diffstat (limited to 'csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs')
-rw-r--r--csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs36
1 files changed, 18 insertions, 18 deletions
diff --git a/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs
index 7feb0448..227b53d2 100644
--- a/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs
+++ b/csharp/src/ProtocolBuffersLite.Test/InteropLiteTest.cs
@@ -36,27 +36,27 @@
using System;
using Google.ProtocolBuffers.TestProtos;
-using Xunit;
+using NUnit.Framework;
namespace Google.ProtocolBuffers
{
public class InteropLiteTest
{
- [Fact]
+ [Test]
public void TestConvertFromFullMinimal()
{
TestInteropPerson person = TestInteropPerson.CreateBuilder()
.SetId(123)
.SetName("abc")
.Build();
- Assert.True(person.IsInitialized);
+ Assert.IsTrue(person.IsInitialized);
TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(person.ToByteArray());
- Assert.Equal(person.ToByteArray(), copy.ToByteArray());
+ Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
}
- [Fact]
+ [Test]
public void TestConvertFromFullComplete()
{
TestInteropPerson person = TestInteropPerson.CreateBuilder()
@@ -72,7 +72,7 @@ namespace Google.ProtocolBuffers
.SetExtension(UnittestExtrasFull.EmployeeId,
TestInteropEmployeeId.CreateBuilder().SetNumber("123").Build())
.Build();
- Assert.True(person.IsInitialized);
+ Assert.IsTrue(person.IsInitialized);
ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
UnittestExtrasLite.RegisterAllExtensions(registry);
@@ -81,24 +81,24 @@ namespace Google.ProtocolBuffers
TestInteropPersonLite copy = TestInteropPersonLite.ParseFrom(fullBytes, registry);
byte[] liteBytes = copy.ToByteArray();
- Assert.Equal(fullBytes, liteBytes);
+ Assert.AreEqual(fullBytes, liteBytes);
}
- [Fact]
+ [Test]
public void TestConvertFromLiteMinimal()
{
TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder()
.SetId(123)
.SetName("abc")
.Build();
- Assert.True(person.IsInitialized);
+ Assert.IsTrue(person.IsInitialized);
TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray());
- Assert.Equal(person.ToByteArray(), copy.ToByteArray());
+ Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
}
- [Fact]
+ [Test]
public void TestConvertFromLiteComplete()
{
TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder()
@@ -114,14 +114,14 @@ namespace Google.ProtocolBuffers
.SetExtension(UnittestExtrasLite.EmployeeIdLite,
TestInteropEmployeeIdLite.CreateBuilder().SetNumber("123").Build())
.Build();
- Assert.True(person.IsInitialized);
+ Assert.IsTrue(person.IsInitialized);
ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
UnittestExtrasFull.RegisterAllExtensions(registry);
TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry);
- Assert.Equal(person.ToByteArray(), copy.ToByteArray());
+ Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
}
public ByteString AllBytes
@@ -135,7 +135,7 @@ namespace Google.ProtocolBuffers
}
}
- [Fact]
+ [Test]
public void TestCompareStringValues()
{
TestInteropPersonLite person = TestInteropPersonLite.CreateBuilder()
@@ -153,14 +153,14 @@ namespace Google.ProtocolBuffers
.SetExtension(UnittestExtrasLite.EmployeeIdLite,
TestInteropEmployeeIdLite.CreateBuilder().SetNumber("123").Build())
.Build();
- Assert.True(person.IsInitialized);
+ Assert.IsTrue(person.IsInitialized);
ExtensionRegistry registry = ExtensionRegistry.CreateInstance();
UnittestExtrasFull.RegisterAllExtensions(registry);
TestInteropPerson copy = TestInteropPerson.ParseFrom(person.ToByteArray(), registry);
- Assert.Equal(person.ToByteArray(), copy.ToByteArray());
+ Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
TestInteropPerson.Builder copyBuilder = TestInteropPerson.CreateBuilder();
TextFormat.Merge(
@@ -168,7 +168,7 @@ namespace Google.ProtocolBuffers
"[protobuf_unittest_extra.employee_id]"), registry, copyBuilder);
copy = copyBuilder.Build();
- Assert.Equal(person.ToByteArray(), copy.ToByteArray());
+ Assert.AreEqual(person.ToByteArray(), copy.ToByteArray());
string liteText = person.ToString().TrimEnd().Replace("\r", "");
string fullText = copy.ToString().TrimEnd().Replace("\r", "");
@@ -179,7 +179,7 @@ namespace Google.ProtocolBuffers
while (fullText.IndexOf("\n ", StringComparison.Ordinal) >= 0)
fullText = fullText.Replace("\n ", "\n");
- Assert.Equal(fullText, liteText);
+ Assert.AreEqual(fullText, liteText);
}
}
} \ No newline at end of file