aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2015-04-30 11:05:36 +0100
committerJon Skeet <jonskeet@google.com>2015-04-30 11:29:35 +0100
commitc56475088d2d36d29a2640f35b9a8621796c051c (patch)
treeeee4106598d0faf92b566f7e03930f25df38a56c /csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs
parentce97e686826147e2a071fd2321555f7d40ec5d93 (diff)
downloadprotobuf-c56475088d2d36d29a2640f35b9a8621796c051c.tar.gz
protobuf-c56475088d2d36d29a2640f35b9a8621796c051c.tar.bz2
protobuf-c56475088d2d36d29a2640f35b9a8621796c051c.zip
Change to using xUnit for all unit tests, and fetch that via NuGet.
This includes fetching the VS unit test runner package, so that tests can be run from Visual Studio's Test Explorer.
Diffstat (limited to 'csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs')
-rw-r--r--csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs16
1 files changed, 6 insertions, 10 deletions
diff --git a/csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs b/csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs
index c3ce5883..4d1187a4 100644
--- a/csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs
+++ b/csharp/src/ProtocolBuffers.Test/Compatibility/TestResources.cs
@@ -1,8 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System.IO;
+using Xunit;
namespace Google.ProtocolBuffers.Compatibility
{
@@ -15,11 +12,11 @@ namespace Google.ProtocolBuffers.Compatibility
Stream resource = typeof(TestResources).Assembly.GetManifestResourceStream(
typeof(TestResources).Namespace + ".google_message1.dat");
- Assert.IsNotNull(resource, "Unable to the locate resource: google_message1");
+ Assert.NotNull(resource);
byte[] bytes = new byte[resource.Length];
int amtRead = resource.Read(bytes, 0, bytes.Length);
- Assert.AreEqual(bytes.Length, amtRead);
+ Assert.Equal(bytes.Length, amtRead);
return bytes;
}
}
@@ -30,11 +27,10 @@ namespace Google.ProtocolBuffers.Compatibility
Stream resource = typeof(TestResources).Assembly.GetManifestResourceStream(
typeof(TestResources).Namespace + ".google_message2.dat");
- Assert.IsNotNull(resource, "Unable to the locate resource: google_message2");
-
+ Assert.NotNull(resource);
byte[] bytes = new byte[resource.Length];
int amtRead = resource.Read(bytes, 0, bytes.Length);
- Assert.AreEqual(bytes.Length, amtRead);
+ Assert.Equal(bytes.Length, amtRead);
return bytes;
}
}