From c56475088d2d36d29a2640f35b9a8621796c051c Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 30 Apr 2015 11:05:36 +0100 Subject: 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. --- .../ProtocolBuffers.Test/DeprecatedMemberTest.cs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'csharp/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs') diff --git a/csharp/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs b/csharp/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs index 0901f043..21d21928 100644 --- a/csharp/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs +++ b/csharp/src/ProtocolBuffers.Test/DeprecatedMemberTest.cs @@ -1,22 +1,19 @@ using System; -using System.Collections.Generic; using System.Reflection; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; using UnitTest.Issues.TestProtos; +using Xunit; namespace Google.ProtocolBuffers { - [TestClass] public class DeprecatedMemberTest { private static void AssertIsDeprecated(MemberInfo member) { - Assert.IsNotNull(member); - Assert.IsTrue(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member); + Assert.NotNull(member); + Assert.True(member.IsDefined(typeof(ObsoleteAttribute), false), "Member not obsolete: " + member); } - [TestMethod] + [Fact] public void TestDepreatedPrimitiveValue() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasPrimitiveValue")); @@ -27,7 +24,7 @@ namespace Google.ProtocolBuffers AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearPrimitiveValue")); AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetPrimitiveValue")); } - [TestMethod] + [Fact] public void TestDepreatedPrimitiveArray() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("PrimitiveArrayList")); @@ -42,7 +39,7 @@ namespace Google.ProtocolBuffers AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddRangePrimitiveArray")); AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearPrimitiveArray")); } - [TestMethod] + [Fact] public void TestDepreatedMessageValue() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasMessageValue")); @@ -55,7 +52,7 @@ namespace Google.ProtocolBuffers AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetMessageValue", new[] { typeof(DeprecatedChild) })); AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetMessageValue", new[] { typeof(DeprecatedChild.Builder) })); } - [TestMethod] + [Fact] public void TestDepreatedMessageArray() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("MessageArrayList")); @@ -72,7 +69,7 @@ namespace Google.ProtocolBuffers AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("AddRangeMessageArray")); AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearMessageArray")); } - [TestMethod] + [Fact] public void TestDepreatedEnumValue() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("HasEnumValue")); @@ -83,7 +80,7 @@ namespace Google.ProtocolBuffers AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("ClearEnumValue")); AssertIsDeprecated(typeof(DeprecatedFieldsMessage.Builder).GetMethod("SetEnumValue")); } - [TestMethod] + [Fact] public void TestDepreatedEnumArray() { AssertIsDeprecated(typeof(DeprecatedFieldsMessage).GetProperty("EnumArrayList")); -- cgit v1.2.3