aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs')
-rw-r--r--csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs31
1 files changed, 13 insertions, 18 deletions
diff --git a/csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs b/csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs
index 4c33dbbd..186d9399 100644
--- a/csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs
+++ b/csharp/src/ProtocolBuffers.Test/MessageUtilTest.cs
@@ -36,52 +36,47 @@
using System;
using Google.ProtocolBuffers.TestProtos;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Xunit;
namespace Google.ProtocolBuffers
{
- [TestClass]
public class MessageUtilTest
{
- [TestMethod]
- [ExpectedException(typeof(ArgumentNullException))]
+ [Fact]
public void NullTypeName()
{
- MessageUtil.GetDefaultMessage((string) null);
+ Assert.Throws<ArgumentNullException>(() => MessageUtil.GetDefaultMessage((string) null));
}
- [TestMethod]
- [ExpectedException(typeof(ArgumentException))]
+ [Fact]
public void InvalidTypeName()
{
- MessageUtil.GetDefaultMessage("invalidtypename");
+ Assert.Throws<ArgumentException>(() => MessageUtil.GetDefaultMessage("invalidtypename"));
}
- [TestMethod]
+ [Fact]
public void ValidTypeName()
{
- Assert.AreSame(TestAllTypes.DefaultInstance,
+ Assert.Same(TestAllTypes.DefaultInstance,
MessageUtil.GetDefaultMessage(typeof(TestAllTypes).AssemblyQualifiedName));
}
- [TestMethod]
- [ExpectedException(typeof(ArgumentNullException))]
+ [Fact]
public void NullType()
{
- MessageUtil.GetDefaultMessage((Type) null);
+ Assert.Throws<ArgumentNullException>(() => MessageUtil.GetDefaultMessage((Type)null));
}
- [TestMethod]
- [ExpectedException(typeof(ArgumentException))]
+ [Fact]
public void NonMessageType()
{
- MessageUtil.GetDefaultMessage(typeof(string));
+ Assert.Throws<ArgumentException>(() => MessageUtil.GetDefaultMessage(typeof(string)));
}
- [TestMethod]
+ [Fact]
public void ValidType()
{
- Assert.AreSame(TestAllTypes.DefaultInstance, MessageUtil.GetDefaultMessage(typeof(TestAllTypes)));
+ Assert.Same(TestAllTypes.DefaultInstance, MessageUtil.GetDefaultMessage(typeof(TestAllTypes)));
}
}
} \ No newline at end of file