diff options
author | Jon Skeet <jonskeet@google.com> | 2015-04-30 11:05:36 +0100 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2015-04-30 11:29:35 +0100 |
commit | c56475088d2d36d29a2640f35b9a8621796c051c (patch) | |
tree | eee4106598d0faf92b566f7e03930f25df38a56c /csharp/src/ProtocolBuffersLite.Test/LiteTest.cs | |
parent | ce97e686826147e2a071fd2321555f7d40ec5d93 (diff) | |
download | protobuf-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/ProtocolBuffersLite.Test/LiteTest.cs')
-rw-r--r-- | csharp/src/ProtocolBuffersLite.Test/LiteTest.cs | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs b/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs index 9ef5cc84..8ffd3ee2 100644 --- a/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs +++ b/csharp/src/ProtocolBuffersLite.Test/LiteTest.cs @@ -34,12 +34,8 @@ #endregion
-using System;
-using System.Collections.Generic;
-using System.IO;
-using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Xunit;
namespace Google.ProtocolBuffers
{
@@ -47,10 +43,9 @@ namespace Google.ProtocolBuffers /// Miscellaneous tests for message operations that apply to both
/// generated and dynamic messages.
/// </summary>
- [TestClass]
public class LiteTest
{
- [TestMethod]
+ [Fact]
public void TestLite()
{
// Since lite messages are a subset of regular messages, we can mostly
@@ -73,13 +68,13 @@ namespace Google.ProtocolBuffers TestAllTypesLite message2 = TestAllTypesLite.ParseFrom(data);
- Assert.AreEqual(123, message2.OptionalInt32);
- Assert.AreEqual(1, message2.RepeatedStringCount);
- Assert.AreEqual("hello", message2.RepeatedStringList[0]);
- Assert.AreEqual(7, message2.OptionalNestedMessage.Bb);
+ Assert.Equal(123, message2.OptionalInt32);
+ Assert.Equal(1, message2.RepeatedStringCount);
+ Assert.Equal("hello", message2.RepeatedStringList[0]);
+ Assert.Equal(7, message2.OptionalNestedMessage.Bb);
}
- [TestMethod]
+ [Fact]
public void TestLiteExtensions()
{
// TODO(kenton): Unlike other features of the lite library, extensions are
@@ -101,17 +96,17 @@ namespace Google.ProtocolBuffers // writing, parsing hasn't been implemented yet.
TestAllExtensionsLite message2 = message.ToBuilder().Build();
- Assert.AreEqual(123, (int) message2.GetExtension(
+ Assert.Equal(123, (int) message2.GetExtension(
UnittestLite.OptionalInt32ExtensionLite));
- Assert.AreEqual(1, message2.GetExtensionCount(
+ Assert.Equal(1, message2.GetExtensionCount(
UnittestLite.RepeatedStringExtensionLite));
- Assert.AreEqual(1, message2.GetExtension(
+ Assert.Equal(1, message2.GetExtension(
UnittestLite.RepeatedStringExtensionLite).Count);
- Assert.AreEqual("hello", message2.GetExtension(
+ Assert.Equal("hello", message2.GetExtension(
UnittestLite.RepeatedStringExtensionLite, 0));
- Assert.AreEqual(TestAllTypesLite.Types.NestedEnum.BAZ, message2.GetExtension(
+ Assert.Equal(TestAllTypesLite.Types.NestedEnum.BAZ, message2.GetExtension(
UnittestLite.OptionalNestedEnumExtensionLite));
- Assert.AreEqual(7, message2.GetExtension(
+ Assert.Equal(7, message2.GetExtension(
UnittestLite.OptionalNestedMessageExtensionLite).Bb);
}
}
|