aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers.Test/GeneratedBuilderTest.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/ProtocolBuffers.Test/GeneratedBuilderTest.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/ProtocolBuffers.Test/GeneratedBuilderTest.cs')
-rw-r--r--csharp/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs24
1 files changed, 12 insertions, 12 deletions
diff --git a/csharp/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs b/csharp/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs
index 692bfd11..257f5001 100644
--- a/csharp/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs
+++ b/csharp/src/ProtocolBuffers.Test/GeneratedBuilderTest.cs
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Google.ProtocolBuffers.TestProtos;
-using Xunit;
+using NUnit.Framework;
namespace Google.ProtocolBuffers
{
@@ -17,7 +17,7 @@ namespace Google.ProtocolBuffers
}
public IEnumerator<T> GetEnumerator()
{
- Assert.False(_enumerated);
+ Assert.IsFalse(_enumerated);
_enumerated = true;
yield return _item;
}
@@ -27,49 +27,49 @@ namespace Google.ProtocolBuffers
}
}
- [Fact]
+ [Test]
public void DoesNotEnumerateTwiceForMessageList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRangeRepeatedForeignMessage(new OneTimeEnumerator<ForeignMessage>(ForeignMessage.DefaultInstance));
}
- [Fact]
+ [Test]
public void DoesNotEnumerateTwiceForPrimitiveList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRangeRepeatedInt32(new OneTimeEnumerator<int>(1));
}
- [Fact]
+ [Test]
public void DoesNotEnumerateTwiceForStringList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRangeRepeatedString(new OneTimeEnumerator<string>("test"));
}
- [Fact]
+ [Test]
public void DoesNotEnumerateTwiceForEnumList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRangeRepeatedForeignEnum(new OneTimeEnumerator<ForeignEnum>(ForeignEnum.FOREIGN_BAR));
}
- [Fact]
+ [Test]
public void DoesNotAddNullToMessageListByAddRange()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
Assert.Throws<ArgumentNullException>(() => b.AddRangeRepeatedForeignMessage(new ForeignMessage[] { null }));
}
- [Fact]
+ [Test]
public void DoesNotAddNullToMessageListByAdd()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
Assert.Throws<ArgumentNullException>(() => b.AddRepeatedForeignMessage((ForeignMessage)null));
}
- [Fact]
+ [Test]
public void DoesNotAddNullToMessageListBySet()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
@@ -77,21 +77,21 @@ namespace Google.ProtocolBuffers
Assert.Throws<ArgumentNullException>(() => b.SetRepeatedForeignMessage(0, (ForeignMessage)null));
}
- [Fact]
+ [Test]
public void DoesNotAddNullToStringListByAddRange()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
Assert.Throws<ArgumentNullException>(() => b.AddRangeRepeatedString(new String[] { null }));
}
- [Fact]
+ [Test]
public void DoesNotAddNullToStringListByAdd()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
Assert.Throws<ArgumentNullException>(() => b.AddRepeatedString(null));
}
- [Fact]
+ [Test]
public void DoesNotAddNullToStringListBySet()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();