Commit 0884b779 authored by Jon Skeet's avatar Jon Skeet

Merge pull request #324 from jskeet/csharp

Change to using xUnit for all unit tests, and fetch that via NuGet.
parents 151018e8 c5647508
......@@ -79,3 +79,6 @@ javanano/target
vsprojects/Debug
vsprojects/Release
# NuGet packages: we want the repository configuration, but not the
# packages themselves.
/csharp/src/packages/*/

using System;
#if CLIENTPROFILE
namespace Microsoft.VisualStudio.TestTools.UnitTesting
{
[AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
public sealed class TestClassAttribute : NUnit.Framework.TestFixtureAttribute
{
}
[AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
public sealed class TestMethodAttribute : NUnit.Framework.TestAttribute
{
}
[AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
public sealed class TestInitializeAttribute : NUnit.Framework.SetUpAttribute
{
}
[AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
public sealed class IgnoreAttribute : NUnit.Framework.IgnoreAttribute
{
}
[AttributeUsage(AttributeTargets.Method, Inherited = true, AllowMultiple = false)]
public sealed class ExpectedExceptionAttribute : NUnit.Framework.ExpectedExceptionAttribute
{
public ExpectedExceptionAttribute(Type type) : base(type)
{ }
}
public class Assert : NUnit.Framework.Assert
{
[Obsolete("Do not use AreEqual on Byte[], use TestUtil.AssertBytesEqual(,)")]
public static void AreEqual(byte[] b1, byte[] b2)
{
NUnit.Framework.Assert.AreEqual(b1, b2);
}
[Obsolete("No not use assert with miss-matched types.")]
public static new void AreEqual(object b1, object b2)
{
NUnit.Framework.Assert.AreEqual(b1, b2);
}
//Allowed if the types match
public static void AreEqual<T>(T b1, T b2)
{
NUnit.Framework.Assert.AreEqual(b1, b2);
}
}
}
#endif
\ No newline at end of file
<?xml version="1.0" encoding="Windows-1252"?>
<configuration>
<startup>
<requiredRuntime version="v2.0.50727" />
</startup>
<runtime>
<!-- We need this so test exceptions don't crash NUnit -->
<legacyUnhandledExceptionPolicy enabled="1" />
<!-- Look for addins in the addins directory for now -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;addins"/>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="Windows-1252"?>
<configuration>
<startup>
<requiredRuntime version="v2.0.50727" />
</startup>
<runtime>
<!-- We need this so test exceptions don't crash NUnit -->
<legacyUnhandledExceptionPolicy enabled="1" />
<!-- Look for addins in the addins directory for now -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;addins"/>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="Windows-1252"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<requiredRuntime version="v4.0.30319" safemode="true"/>
</startup>
<runtime>
<!-- We need this so test exceptions don't crash NUnit -->
<legacyUnhandledExceptionPolicy enabled="1" />
<!-- Look for addins in the addins directory for now -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib;addins"/>
</assemblyBinding>
</runtime>
</configuration>
\ No newline at end of file
......@@ -36,113 +36,112 @@
using System;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;
namespace Google.ProtocolBuffers
{
[TestClass]
public class ByteStringTest
{
[TestMethod]
[Fact]
public void EmptyByteStringHasZeroSize()
{
Assert.AreEqual(0, ByteString.Empty.Length);
Assert.Equal(0, ByteString.Empty.Length);
}
[TestMethod]
[Fact]
public void CopyFromStringWithExplicitEncoding()
{
ByteString bs = ByteString.CopyFrom("AB", Encoding.Unicode);
Assert.AreEqual(4, bs.Length);
Assert.AreEqual(65, bs[0]);
Assert.AreEqual(0, bs[1]);
Assert.AreEqual(66, bs[2]);
Assert.AreEqual(0, bs[3]);
Assert.Equal(4, bs.Length);
Assert.Equal(65, bs[0]);
Assert.Equal(0, bs[1]);
Assert.Equal(66, bs[2]);
Assert.Equal(0, bs[3]);
}
[TestMethod]
[Fact]
public void IsEmptyWhenEmpty()
{
Assert.IsTrue(ByteString.CopyFromUtf8("").IsEmpty);
Assert.True(ByteString.CopyFromUtf8("").IsEmpty);
}
[TestMethod]
[Fact]
public void IsEmptyWhenNotEmpty()
{
Assert.IsFalse(ByteString.CopyFromUtf8("X").IsEmpty);
Assert.False(ByteString.CopyFromUtf8("X").IsEmpty);
}
[TestMethod]
[Fact]
public void CopyFromByteArrayCopiesContents()
{
byte[] data = new byte[1];
data[0] = 10;
ByteString bs = ByteString.CopyFrom(data);
Assert.AreEqual(10, bs[0]);
Assert.Equal(10, bs[0]);
data[0] = 5;
Assert.AreEqual(10, bs[0]);
Assert.Equal(10, bs[0]);
}
[TestMethod]
[Fact]
public void ToByteArrayCopiesContents()
{
ByteString bs = ByteString.CopyFromUtf8("Hello");
byte[] data = bs.ToByteArray();
Assert.AreEqual((byte)'H', data[0]);
Assert.AreEqual((byte)'H', bs[0]);
Assert.Equal((byte)'H', data[0]);
Assert.Equal((byte)'H', bs[0]);
data[0] = 0;
Assert.AreEqual(0, data[0]);
Assert.AreEqual((byte)'H', bs[0]);
Assert.Equal(0, data[0]);
Assert.Equal((byte)'H', bs[0]);
}
[TestMethod]
[Fact]
public void CopyFromUtf8UsesUtf8()
{
ByteString bs = ByteString.CopyFromUtf8("\u20ac");
Assert.AreEqual(3, bs.Length);
Assert.AreEqual(0xe2, bs[0]);
Assert.AreEqual(0x82, bs[1]);
Assert.AreEqual(0xac, bs[2]);
Assert.Equal(3, bs.Length);
Assert.Equal(0xe2, bs[0]);
Assert.Equal(0x82, bs[1]);
Assert.Equal(0xac, bs[2]);
}
[TestMethod]
[Fact]
public void CopyFromPortion()
{
byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6};
ByteString bs = ByteString.CopyFrom(data, 2, 3);
Assert.AreEqual(3, bs.Length);
Assert.AreEqual(2, bs[0]);
Assert.AreEqual(3, bs[1]);
Assert.Equal(3, bs.Length);
Assert.Equal(2, bs[0]);
Assert.Equal(3, bs[1]);
}
[TestMethod]
[Fact]
public void ToStringUtf8()
{
ByteString bs = ByteString.CopyFromUtf8("\u20ac");
Assert.AreEqual("\u20ac", bs.ToStringUtf8());
Assert.Equal("\u20ac", bs.ToStringUtf8());
}
[TestMethod]
[Fact]
public void ToStringWithExplicitEncoding()
{
ByteString bs = ByteString.CopyFrom("\u20ac", Encoding.Unicode);
Assert.AreEqual("\u20ac", bs.ToString(Encoding.Unicode));
Assert.Equal("\u20ac", bs.ToString(Encoding.Unicode));
}
[TestMethod]
[Fact]
public void FromBase64_WithText()
{
byte[] data = new byte[] {0, 1, 2, 3, 4, 5, 6};
string base64 = Convert.ToBase64String(data);
ByteString bs = ByteString.FromBase64(base64);
TestUtil.AssertBytesEqual(data, bs.ToByteArray());
Assert.Equal(data, bs.ToByteArray());
}
[TestMethod]
[Fact]
public void FromBase64_Empty()
{
// Optimization which also fixes issue 61.
Assert.AreSame(ByteString.Empty, ByteString.FromBase64(""));
Assert.Same(ByteString.Empty, ByteString.FromBase64(""));
}
}
}
\ No newline at end of file
......@@ -36,40 +36,39 @@
using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;
namespace Google.ProtocolBuffers.Collections
{
[TestClass]
public class PopsicleListTest
{
[TestMethod]
[Fact]
public void MutatingOperationsOnFrozenList()
{
PopsicleList<string> list = new PopsicleList<string>();
list.MakeReadOnly();
TestUtil.AssertNotSupported(() => list.Add(""));
TestUtil.AssertNotSupported(() => list.Clear());
TestUtil.AssertNotSupported(() => list.Insert(0, ""));
TestUtil.AssertNotSupported(() => list.Remove(""));
TestUtil.AssertNotSupported(() => list.RemoveAt(0));
TestUtil.AssertNotSupported(() => list.Add(new[] { "", "" }));
Assert.Throws<NotSupportedException>(() => list.Add(""));
Assert.Throws<NotSupportedException>(() => list.Clear());
Assert.Throws<NotSupportedException>(() => list.Insert(0, ""));
Assert.Throws<NotSupportedException>(() => list.Remove(""));
Assert.Throws<NotSupportedException>(() => list.RemoveAt(0));
Assert.Throws<NotSupportedException>(() => list.Add(new[] { "", "" }));
}
[TestMethod]
[Fact]
public void NonMutatingOperationsOnFrozenList()
{
PopsicleList<string> list = new PopsicleList<string>();
list.MakeReadOnly();
Assert.IsFalse(list.Contains(""));
Assert.AreEqual(0, list.Count);
Assert.False(list.Contains(""));
Assert.Equal(0, list.Count);
list.CopyTo(new string[5], 0);
list.GetEnumerator();
Assert.AreEqual(-1, list.IndexOf(""));
Assert.IsTrue(list.IsReadOnly);
Assert.Equal(-1, list.IndexOf(""));
Assert.True(list.IsReadOnly);
}
[TestMethod]
[Fact]
public void MutatingOperationsOnFluidList()
{
PopsicleList<string> list = new PopsicleList<string>();
......@@ -81,73 +80,46 @@ namespace Google.ProtocolBuffers.Collections
list.RemoveAt(0);
}
[TestMethod]
[Fact]
public void NonMutatingOperationsOnFluidList()
{
PopsicleList<string> list = new PopsicleList<string>();
Assert.IsFalse(list.Contains(""));
Assert.AreEqual(0, list.Count);
Assert.False(list.Contains(""));
Assert.Equal(0, list.Count);
list.CopyTo(new string[5], 0);
list.GetEnumerator();
Assert.AreEqual(-1, list.IndexOf(""));
Assert.IsFalse(list.IsReadOnly);
Assert.Equal(-1, list.IndexOf(""));
Assert.False(list.IsReadOnly);
}
[TestMethod]
[Fact]
public void DoesNotAddNullEnumerable()
{
PopsicleList<string> list = new PopsicleList<string>();
try
{
list.Add((IEnumerable<string>)null);
}
catch (ArgumentNullException)
{ return; }
Assert.Fail("List should not allow nulls.");
Assert.Throws<ArgumentNullException>(() => list.Add((IEnumerable<string>) null));
}
[TestMethod]
[Fact]
public void DoesNotAddRangeWithNull()
{
PopsicleList<string> list = new PopsicleList<string>();
try
{
list.Add(new[] { "a", "b", null });
}
catch (ArgumentNullException)
{ return; }
Assert.Fail("List should not allow nulls.");
// TODO(jonskeet): Change to ArgumentException? The argument isn't null...
Assert.Throws<ArgumentNullException>(() => list.Add(new[] {"a", "b", null}));
}
[TestMethod]
[Fact]
public void DoesNotAddNull()
{
PopsicleList<string> list = new PopsicleList<string>();
try
{
list.Add((string)null);
}
catch (ArgumentNullException)
{ return; }
Assert.Fail("List should not allow nulls.");
Assert.Throws<ArgumentNullException>(() => list.Add((string) null));
}
[TestMethod]
[Fact]
public void DoesNotSetNull()
{
PopsicleList<string> list = new PopsicleList<string>();
list.Add("a");
try
{
list[0] = null;
}
catch (ArgumentNullException)
{ return; }
Assert.Fail("List should not allow nulls.");
Assert.Throws<ArgumentNullException>(() => list[0] = null);
}
}
}
\ No newline at end of file
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers.Compatibility
{
[TestClass]
public class BinaryCompatibilityTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
......
using System;
using Google.ProtocolBuffers.TestProtos;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;
namespace Google.ProtocolBuffers.Compatibility
......@@ -22,10 +22,10 @@ namespace Google.ProtocolBuffers.Compatibility
protected virtual void AssertOutputEquals(object lhs, object rhs)
{
Assert.AreEqual<object>(lhs, rhs);
Assert.Equal<object>(lhs, rhs);
}
[TestMethod]
[Fact]
public virtual void RoundTripWithEmptyChildMessageSize()
{
SizeMessage1 msg = SizeMessage1.CreateBuilder()
......@@ -37,12 +37,12 @@ namespace Google.ProtocolBuffers.Compatibility
SizeMessage1 copy = DeserializeMessage<SizeMessage1, SizeMessage1.Builder>(content, SizeMessage1.CreateBuilder(), ExtensionRegistry.Empty).BuildPartial();
Assert.AreEqual(msg, copy);
Assert.Equal(msg, copy);
AssertOutputEquals(content, SerializeMessage<SizeMessage1, SizeMessage1.Builder>(copy));
Assert.AreEqual(Convert.ToBase64String(contents), Convert.ToBase64String(copy.ToByteArray()));
Assert.Equal(Convert.ToBase64String(contents), Convert.ToBase64String(copy.ToByteArray()));
}
[TestMethod]
[Fact]
public virtual void RoundTripWithEmptyChildMessageSpeed()
{
SpeedMessage1 msg = SpeedMessage1.CreateBuilder()
......@@ -54,12 +54,12 @@ namespace Google.ProtocolBuffers.Compatibility
SpeedMessage1 copy = DeserializeMessage<SpeedMessage1, SpeedMessage1.Builder>(content, SpeedMessage1.CreateBuilder(), ExtensionRegistry.Empty).BuildPartial();
Assert.AreEqual(msg, copy);
Assert.Equal(msg, copy);
AssertOutputEquals(content, SerializeMessage<SpeedMessage1, SpeedMessage1.Builder>(copy));
Assert.AreEqual(Convert.ToBase64String(contents), Convert.ToBase64String(copy.ToByteArray()));
Assert.Equal(Convert.ToBase64String(contents), Convert.ToBase64String(copy.ToByteArray()));
}
[TestMethod]
[Fact]
public virtual void RoundTripMessage1OptimizeSize()
{
SizeMessage1 msg = SizeMessage1.CreateBuilder().MergeFrom(TestResources.google_message1).Build();
......@@ -67,12 +67,12 @@ namespace Google.ProtocolBuffers.Compatibility
SizeMessage1 copy = DeserializeMessage<SizeMessage1, SizeMessage1.Builder>(content, SizeMessage1.CreateBuilder(), ExtensionRegistry.Empty).Build();
Assert.AreEqual(msg, copy);
Assert.Equal(msg, copy);
AssertOutputEquals(content, SerializeMessage<SizeMessage1, SizeMessage1.Builder>(copy));
Assert.AreEqual(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray()));
Assert.Equal(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray()));
}
[TestMethod]
[Fact]
public virtual void RoundTripMessage2OptimizeSize()
{
SizeMessage2 msg = SizeMessage2.CreateBuilder().MergeFrom(TestResources.google_message2).Build();
......@@ -80,12 +80,12 @@ namespace Google.ProtocolBuffers.Compatibility
SizeMessage2 copy = DeserializeMessage<SizeMessage2, SizeMessage2.Builder>(content, SizeMessage2.CreateBuilder(), ExtensionRegistry.Empty).Build();
Assert.AreEqual(msg, copy);
Assert.Equal(msg, copy);
AssertOutputEquals(content, SerializeMessage<SizeMessage2, SizeMessage2.Builder>(copy));
Assert.AreEqual(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray()));
Assert.Equal(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray()));
}
[TestMethod]
[Fact]
public virtual void RoundTripMessage1OptimizeSpeed()
{
SpeedMessage1 msg = SpeedMessage1.CreateBuilder().MergeFrom(TestResources.google_message1).Build();
......@@ -93,12 +93,12 @@ namespace Google.ProtocolBuffers.Compatibility
SpeedMessage1 copy = DeserializeMessage<SpeedMessage1, SpeedMessage1.Builder>(content, SpeedMessage1.CreateBuilder(), ExtensionRegistry.Empty).Build();
Assert.AreEqual(msg, copy);
Assert.Equal(msg, copy);
AssertOutputEquals(content, SerializeMessage<SpeedMessage1, SpeedMessage1.Builder>(copy));
Assert.AreEqual(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray()));
Assert.Equal(Convert.ToBase64String(TestResources.google_message1), Convert.ToBase64String(copy.ToByteArray()));
}
[TestMethod]
[Fact]
public virtual void RoundTripMessage2OptimizeSpeed()
{
SpeedMessage2 msg = SpeedMessage2.CreateBuilder().MergeFrom(TestResources.google_message2).Build();
......@@ -106,9 +106,9 @@ namespace Google.ProtocolBuffers.Compatibility
SpeedMessage2 copy = DeserializeMessage<SpeedMessage2, SpeedMessage2.Builder>(content, SpeedMessage2.CreateBuilder(), ExtensionRegistry.Empty).Build();
Assert.AreEqual(msg, copy);
Assert.Equal(msg, copy);
AssertOutputEquals(content, SerializeMessage<SpeedMessage2, SpeedMessage2.Builder>(copy));
Assert.AreEqual(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray()));
Assert.Equal(Convert.ToBase64String(TestResources.google_message2), Convert.ToBase64String(copy.ToByteArray()));
}
#region Test message builders
......@@ -185,7 +185,7 @@ namespace Google.ProtocolBuffers.Compatibility
#endregion
[TestMethod]
[Fact]
public void TestRoundTripAllTypes()
{
TestAllTypes msg = AddAllTypes(new TestAllTypes.Builder()).Build();
......@@ -193,12 +193,12 @@ namespace Google.ProtocolBuffers.Compatibility
TestAllTypes copy = DeserializeMessage<TestAllTypes, TestAllTypes.Builder>(content, TestAllTypes.CreateBuilder(), ExtensionRegistry.Empty).Build();
Assert.AreEqual(msg, copy);
Assert.Equal(msg, copy);
AssertOutputEquals(content, SerializeMessage<TestAllTypes, TestAllTypes.Builder>(copy));
Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray()));
Assert.Equal(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray()));
}
[TestMethod]
[Fact]
public void TestRoundTripRepeatedTypes()
{
TestAllTypes msg = AddRepeatedTypes(new TestAllTypes.Builder(), 5).Build();
......@@ -206,12 +206,12 @@ namespace Google.ProtocolBuffers.Compatibility
TestAllTypes copy = DeserializeMessage<TestAllTypes, TestAllTypes.Builder>(content, TestAllTypes.CreateBuilder(), ExtensionRegistry.Empty).Build();
Assert.AreEqual(msg, copy);
Assert.Equal(msg, copy);
AssertOutputEquals(content, SerializeMessage<TestAllTypes, TestAllTypes.Builder>(copy));
Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray()));
Assert.Equal(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray()));
}
[TestMethod]
[Fact]
public void TestRoundTripPackedTypes()
{
TestPackedTypes msg = AddPackedTypes(new TestPackedTypes.Builder(), 5).Build();
......@@ -219,9 +219,9 @@ namespace Google.ProtocolBuffers.Compatibility
TestPackedTypes copy = DeserializeMessage<TestPackedTypes, TestPackedTypes.Builder>(content, TestPackedTypes.CreateBuilder(), ExtensionRegistry.Empty).Build();
Assert.AreEqual(msg, copy);
Assert.Equal(msg, copy);
AssertOutputEquals(content, SerializeMessage<TestPackedTypes, TestPackedTypes.Builder>(copy));
Assert.AreEqual(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray()));
Assert.Equal(Convert.ToBase64String(msg.ToByteArray()), Convert.ToBase64String(copy.ToByteArray()));
}
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Google.ProtocolBuffers.Serialization;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;
namespace Google.ProtocolBuffers.Compatibility
{
[TestClass]
public class DictionaryCompatibilityTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
......@@ -28,7 +25,7 @@ namespace Google.ProtocolBuffers.Compatibility
IDictionary<string, object> left = (IDictionary<string, object>)lhs;
IDictionary<string, object> right = (IDictionary<string, object>)rhs;
Assert.AreEqual(
Assert.Equal(
String.Join(",", new List<string>(left.Keys).ToArray()),
String.Join(",", new List<string>(right.Keys).ToArray())
);
......
using System.IO;
using System.Text;
using Google.ProtocolBuffers.Serialization;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers.Compatibility
{
[TestClass]
public class JsonCompatibilityTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
......@@ -23,7 +20,6 @@ namespace Google.ProtocolBuffers.Compatibility
}
}
[TestClass]
public class JsonCompatibilityFormattedTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
......
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;
}
}
......
using System.ComponentModel;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;
namespace Google.ProtocolBuffers.Compatibility
{
[TestClass]
public class TextCompatibilityTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
......@@ -20,14 +18,14 @@ namespace Google.ProtocolBuffers.Compatibility
return builder;
}
//This test can take a very long time to run.
[TestMethod]
[Fact]
public override void RoundTripMessage2OptimizeSize()
{
//base.RoundTripMessage2OptimizeSize();
}
//This test can take a very long time to run.
[TestMethod]
[Fact]
public override void RoundTripMessage2OptimizeSpeed()
{
//base.RoundTripMessage2OptimizeSpeed();
......
using System.IO;
using System.Xml;
using Google.ProtocolBuffers.Serialization;
using Google.ProtocolBuffers.TestProtos;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Google.ProtocolBuffers.Compatibility
{
[TestClass]
public class XmlCompatibilityTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
......@@ -24,7 +21,6 @@ namespace Google.ProtocolBuffers.Compatibility
}
}
[TestClass]
public class XmlCompatibilityFormattedTests : CompatibilityTests
{
protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
......
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"));
......
......@@ -37,26 +37,24 @@
using System;
using System.Collections.Generic;
using Google.ProtocolBuffers.TestProtos;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;
namespace Google.ProtocolBuffers
{
[TestClass]
public class DynamicMessageTest
{
private ReflectionTester reflectionTester;
private ReflectionTester extensionsReflectionTester;
private ReflectionTester packedReflectionTester;
[TestInitialize]
public void SetUp()
public DynamicMessageTest()
{
reflectionTester = ReflectionTester.CreateTestAllTypesInstance();
extensionsReflectionTester = ReflectionTester.CreateTestAllExtensionsInstance();
packedReflectionTester = ReflectionTester.CreateTestPackedTypesInstance();
}
[TestMethod]
[Fact]
public void DynamicMessageAccessors()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
......@@ -65,30 +63,22 @@ namespace Google.ProtocolBuffers
reflectionTester.AssertAllFieldsSetViaReflection(message);
}
[TestMethod]
[Fact]
public void DoubleBuildError()
{
DynamicMessage.Builder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
builder.Build();
try
{
builder.Build();
Assert.Fail("Should have thrown exception.");
}
catch (InvalidOperationException)
{
// Success.
}
}
[TestMethod]
Assert.Throws<InvalidOperationException>(() => builder.Build());
}
[Fact]
public void DynamicMessageSettersRejectNull()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
reflectionTester.AssertReflectionSettersRejectNull(builder);
}
[TestMethod]
[Fact]
public void DynamicMessageExtensionAccessors()
{
// We don't need to extensively test DynamicMessage's handling of
......@@ -100,14 +90,14 @@ namespace Google.ProtocolBuffers
extensionsReflectionTester.AssertAllFieldsSetViaReflection(message);
}
[TestMethod]
[Fact]
public void DynamicMessageExtensionSettersRejectNull()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllExtensions.Descriptor);
extensionsReflectionTester.AssertReflectionSettersRejectNull(builder);
}
[TestMethod]
[Fact]
public void DynamicMessageRepeatedSetters()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
......@@ -117,21 +107,21 @@ namespace Google.ProtocolBuffers
reflectionTester.AssertRepeatedFieldsModifiedViaReflection(message);
}
[TestMethod]
[Fact]
public void DynamicMessageRepeatedSettersRejectNull()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
reflectionTester.AssertReflectionRepeatedSettersRejectNull(builder);
}
[TestMethod]
[Fact]
public void DynamicMessageDefaults()
{
reflectionTester.AssertClearViaReflection(DynamicMessage.GetDefaultInstance(TestAllTypes.Descriptor));
reflectionTester.AssertClearViaReflection(DynamicMessage.CreateBuilder(TestAllTypes.Descriptor).Build());
}
[TestMethod]
[Fact]
public void DynamicMessageSerializedSize()
{
TestAllTypes message = TestUtil.GetAllSet();
......@@ -140,10 +130,10 @@ namespace Google.ProtocolBuffers
reflectionTester.SetAllFieldsViaReflection(dynamicBuilder);
IMessage dynamicMessage = dynamicBuilder.WeakBuild();
Assert.AreEqual(message.SerializedSize, dynamicMessage.SerializedSize);
Assert.Equal(message.SerializedSize, dynamicMessage.SerializedSize);
}
[TestMethod]
[Fact]
public void DynamicMessageSerialization()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestAllTypes.Descriptor);
......@@ -156,10 +146,10 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllFieldsSet(message2);
// In fact, the serialized forms should be exactly the same, byte-for-byte.
Assert.AreEqual(TestUtil.GetAllSet().ToByteString(), rawBytes);
Assert.Equal(TestUtil.GetAllSet().ToByteString(), rawBytes);
}
[TestMethod]
[Fact]
public void DynamicMessageParsing()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
......@@ -172,7 +162,7 @@ namespace Google.ProtocolBuffers
reflectionTester.AssertAllFieldsSetViaReflection(message2);
}
[TestMethod]
[Fact]
public void DynamicMessagePackedSerialization()
{
IBuilder builder = DynamicMessage.CreateBuilder(TestPackedTypes.Descriptor);
......@@ -185,11 +175,11 @@ namespace Google.ProtocolBuffers
TestUtil.AssertPackedFieldsSet(message2);
// In fact, the serialized forms should be exactly the same, byte-for-byte.
Assert.AreEqual(TestUtil.GetPackedSet().ToByteString(), rawBytes);
Assert.Equal(TestUtil.GetPackedSet().ToByteString(), rawBytes);
}
[TestMethod]
public void testDynamicMessagePackedParsing()
[Fact]
public void DynamicMessagePackedParsing()
{
TestPackedTypes.Builder builder = TestPackedTypes.CreateBuilder();
TestUtil.SetPackedFields(builder);
......@@ -201,7 +191,7 @@ namespace Google.ProtocolBuffers
packedReflectionTester.AssertPackedFieldsSetViaReflection(message2);
}
[TestMethod]
[Fact]
public void DynamicMessageCopy()
{
TestAllTypes.Builder builder = TestAllTypes.CreateBuilder();
......@@ -212,7 +202,7 @@ namespace Google.ProtocolBuffers
reflectionTester.AssertAllFieldsSetViaReflection(copy);
}
[TestMethod]
[Fact]
public void ToBuilder()
{
DynamicMessage.Builder builder =
......@@ -230,8 +220,8 @@ namespace Google.ProtocolBuffers
reflectionTester.AssertAllFieldsSetViaReflection(derived);
IList<ulong> values = derived.UnknownFields.FieldDictionary[unknownFieldNum].VarintList;
Assert.AreEqual(1, values.Count);
Assert.AreEqual(unknownFieldVal, values[0]);
Assert.Equal(1, values.Count);
Assert.Equal(unknownFieldVal, values[0]);
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using Google.ProtocolBuffers.TestProtos;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;
namespace Google.ProtocolBuffers
{
[TestClass]
public class GeneratedBuilderTest
{
class OneTimeEnumerator<T> : IEnumerable<T>
......@@ -19,107 +17,86 @@ namespace Google.ProtocolBuffers
}
public IEnumerator<T> GetEnumerator()
{
Assert.IsFalse(_enumerated, "The collection {0} has already been enumerated", GetType());
Assert.False(_enumerated);
_enumerated = true;
yield return _item;
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{ return GetEnumerator(); }
{
return GetEnumerator();
}
}
[TestMethod]
[Fact]
public void DoesNotEnumerateTwiceForMessageList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRangeRepeatedForeignMessage(
new OneTimeEnumerator<ForeignMessage>(
ForeignMessage.DefaultInstance));
b.AddRangeRepeatedForeignMessage(new OneTimeEnumerator<ForeignMessage>(ForeignMessage.DefaultInstance));
}
[TestMethod]
[Fact]
public void DoesNotEnumerateTwiceForPrimitiveList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRangeRepeatedInt32(new OneTimeEnumerator<int>(1));
}
[TestMethod]
[Fact]
public void DoesNotEnumerateTwiceForStringList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRangeRepeatedString(new OneTimeEnumerator<string>("test"));
}
[TestMethod]
[Fact]
public void DoesNotEnumerateTwiceForEnumList()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRangeRepeatedForeignEnum(new OneTimeEnumerator<ForeignEnum>(ForeignEnum.FOREIGN_BAR));
}
private delegate void TestMethod();
private static void AssertThrows<T>(TestMethod method) where T : Exception
{
try
{
method();
}
catch (Exception error)
{
if (error is T)
return;
throw;
}
Assert.Fail("Expected exception of type " + typeof(T));
}
[TestMethod]
[Fact]
public void DoesNotAddNullToMessageListByAddRange()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
AssertThrows<ArgumentNullException>(
() => b.AddRangeRepeatedForeignMessage(new ForeignMessage[] { null })
);
Assert.Throws<ArgumentNullException>(() => b.AddRangeRepeatedForeignMessage(new ForeignMessage[] { null }));
}
[TestMethod]
[Fact]
public void DoesNotAddNullToMessageListByAdd()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
AssertThrows<ArgumentNullException>(
() => b.AddRepeatedForeignMessage((ForeignMessage)null)
);
Assert.Throws<ArgumentNullException>(() => b.AddRepeatedForeignMessage((ForeignMessage)null));
}
[TestMethod]
[Fact]
public void DoesNotAddNullToMessageListBySet()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRepeatedForeignMessage(ForeignMessage.DefaultInstance);
AssertThrows<ArgumentNullException>(
() => b.SetRepeatedForeignMessage(0, (ForeignMessage)null)
);
Assert.Throws<ArgumentNullException>(() => b.SetRepeatedForeignMessage(0, (ForeignMessage)null));
}
[TestMethod]
[Fact]
public void DoesNotAddNullToStringListByAddRange()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
AssertThrows<ArgumentNullException>(
() => b.AddRangeRepeatedString(new String[] { null })
);
Assert.Throws<ArgumentNullException>(() => b.AddRangeRepeatedString(new String[] { null }));
}
[TestMethod]
[Fact]
public void DoesNotAddNullToStringListByAdd()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
AssertThrows<ArgumentNullException>(
() => b.AddRepeatedString(null)
);
Assert.Throws<ArgumentNullException>(() => b.AddRepeatedString(null));
}
[TestMethod]
[Fact]
public void DoesNotAddNullToStringListBySet()
{
TestAllTypes.Builder b = new TestAllTypes.Builder();
b.AddRepeatedString("one");
AssertThrows<ArgumentNullException>(
() => b.SetRepeatedString(0, null)
);
Assert.Throws<ArgumentNullException>(() => b.SetRepeatedString(0, null));
}
}
}
......@@ -35,13 +35,9 @@
#endregion
using System;
using System.Collections.Generic;
using Google.ProtocolBuffers.Collections;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using UnitTest.Issues.TestProtos;
using Xunit;
namespace Google.ProtocolBuffers
......@@ -49,17 +45,16 @@ namespace Google.ProtocolBuffers
/// <summary>
/// Tests for issues which aren't easily compartmentalized into other unit tests.
/// </summary>
[TestClass]
public class IssuesTest
{
// Issue 45
[TestMethod]
[Fact]
public void FieldCalledItem()
{
ItemField message = new ItemField.Builder { Item = 3 }.Build();
FieldDescriptor field = ItemField.Descriptor.FindFieldByName("item");
Assert.IsNotNull(field);
Assert.AreEqual(3, (int)message[field]);
Assert.NotNull(field);
Assert.Equal(3, (int)message[field]);
}
}
}
......@@ -37,28 +37,27 @@
using System.Collections.Generic;
using System.IO;
using Google.ProtocolBuffers.TestProtos;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;
using NestedMessage = Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage;
namespace Google.ProtocolBuffers
{
[TestClass]
public class MessageStreamIteratorTest
{
[TestMethod]
[Fact]
public void ThreeMessagesInMemory()
{
MemoryStream stream = new MemoryStream(MessageStreamWriterTest.ThreeMessageData);
IEnumerable<NestedMessage> iterator = MessageStreamIterator<NestedMessage>.FromStreamProvider(() => stream);
List<NestedMessage> messages = new List<NestedMessage>(iterator);
Assert.AreEqual(3, messages.Count);
Assert.AreEqual(5, messages[0].Bb);
Assert.AreEqual(1500, messages[1].Bb);
Assert.IsFalse(messages[2].HasBb);
Assert.Equal(3, messages.Count);
Assert.Equal(5, messages[0].Bb);
Assert.Equal(1500, messages[1].Bb);
Assert.False(messages[2].HasBb);
}
[TestMethod]
[Fact]
public void ManyMessagesShouldNotTriggerSizeAlert()
{
int messageSize = TestUtil.GetAllSet().SerializedSize;
......@@ -84,7 +83,7 @@ namespace Google.ProtocolBuffers
count++;
TestUtil.AssertAllFieldsSet(message);
}
Assert.AreEqual(correctCount, count);
Assert.Equal(correctCount, count);
}
}
}
......
......@@ -35,12 +35,11 @@
#endregion
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;
using NestedMessage = Google.ProtocolBuffers.TestProtos.TestAllTypes.Types.NestedMessage;
namespace Google.ProtocolBuffers
{
[TestClass]
public class MessageStreamWriterTest
{
internal static readonly byte[] ThreeMessageData = new byte[]
......@@ -55,7 +54,7 @@ namespace Google.ProtocolBuffers
(1 << 3) | 2, 0, // Field 1, no data (third message)
};
[TestMethod]
[Fact]
public void ThreeMessages()
{
NestedMessage message1 = new NestedMessage.Builder {Bb = 5}.Build();
......
......@@ -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
......@@ -34,49 +34,48 @@
#endregion
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;
namespace Google.ProtocolBuffers
{
[TestClass]
public class NameHelpersTest
{
[TestMethod]
[Fact]
public void UnderscoresToPascalCase()
{
Assert.AreEqual("FooBar", NameHelpers.UnderscoresToPascalCase("Foo_bar"));
Assert.AreEqual("FooBar", NameHelpers.UnderscoresToPascalCase("foo_bar"));
Assert.AreEqual("Foo0Bar", NameHelpers.UnderscoresToPascalCase("Foo0bar"));
Assert.AreEqual("FooBar", NameHelpers.UnderscoresToPascalCase("Foo_+_Bar"));
Assert.Equal("FooBar", NameHelpers.UnderscoresToPascalCase("Foo_bar"));
Assert.Equal("FooBar", NameHelpers.UnderscoresToPascalCase("foo_bar"));
Assert.Equal("Foo0Bar", NameHelpers.UnderscoresToPascalCase("Foo0bar"));
Assert.Equal("FooBar", NameHelpers.UnderscoresToPascalCase("Foo_+_Bar"));
Assert.AreEqual("Bar", NameHelpers.UnderscoresToPascalCase("__+bar"));
Assert.AreEqual("Bar", NameHelpers.UnderscoresToPascalCase("bar_"));
Assert.AreEqual("_0Bar", NameHelpers.UnderscoresToPascalCase("_0bar"));
Assert.AreEqual("_1Bar", NameHelpers.UnderscoresToPascalCase("_1_bar"));
Assert.Equal("Bar", NameHelpers.UnderscoresToPascalCase("__+bar"));
Assert.Equal("Bar", NameHelpers.UnderscoresToPascalCase("bar_"));
Assert.Equal("_0Bar", NameHelpers.UnderscoresToPascalCase("_0bar"));
Assert.Equal("_1Bar", NameHelpers.UnderscoresToPascalCase("_1_bar"));
}
[TestMethod]
[Fact]
public void UnderscoresToCamelCase()
{
Assert.AreEqual("fooBar", NameHelpers.UnderscoresToCamelCase("Foo_bar"));
Assert.AreEqual("fooBar", NameHelpers.UnderscoresToCamelCase("foo_bar"));
Assert.AreEqual("foo0Bar", NameHelpers.UnderscoresToCamelCase("Foo0bar"));
Assert.AreEqual("fooBar", NameHelpers.UnderscoresToCamelCase("Foo_+_Bar"));
Assert.Equal("fooBar", NameHelpers.UnderscoresToCamelCase("Foo_bar"));
Assert.Equal("fooBar", NameHelpers.UnderscoresToCamelCase("foo_bar"));
Assert.Equal("foo0Bar", NameHelpers.UnderscoresToCamelCase("Foo0bar"));
Assert.Equal("fooBar", NameHelpers.UnderscoresToCamelCase("Foo_+_Bar"));
Assert.AreEqual("bar", NameHelpers.UnderscoresToCamelCase("__+bar"));
Assert.AreEqual("bar", NameHelpers.UnderscoresToCamelCase("bar_"));
Assert.AreEqual("_0Bar", NameHelpers.UnderscoresToCamelCase("_0bar"));
Assert.AreEqual("_1Bar", NameHelpers.UnderscoresToCamelCase("_1_bar"));
Assert.Equal("bar", NameHelpers.UnderscoresToCamelCase("__+bar"));
Assert.Equal("bar", NameHelpers.UnderscoresToCamelCase("bar_"));
Assert.Equal("_0Bar", NameHelpers.UnderscoresToCamelCase("_0bar"));
Assert.Equal("_1Bar", NameHelpers.UnderscoresToCamelCase("_1_bar"));
}
[TestMethod]
[Fact]
public void StripSuffix()
{
string text = "FooBar";
Assert.IsFalse(NameHelpers.StripSuffix(ref text, "Foo"));
Assert.AreEqual("FooBar", text);
Assert.IsTrue(NameHelpers.StripSuffix(ref text, "Bar"));
Assert.AreEqual("Foo", text);
Assert.False(NameHelpers.StripSuffix(ref text, "Foo"));
Assert.Equal("FooBar", text);
Assert.True(NameHelpers.StripSuffix(ref text, "Bar"));
Assert.Equal("Foo", text);
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" />
<PropertyGroup>
<EnvironmentFlavor>CLIENTPROFILE</EnvironmentFlavor>
<EnvironmentTemplate>NET35</EnvironmentTemplate>
<EnvironmentProjectType>TEST</EnvironmentProjectType>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
......@@ -13,12 +12,14 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Google.ProtocolBuffers</RootNamespace>
<AssemblyName>Google.ProtocolBuffers.Test</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\keys\Google.ProtocolBuffers.snk</AssemblyOriginatorKeyFile>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<NuGetPackageImportStamp>d37384c8</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
......@@ -32,6 +33,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoStdLib>true</NoStdLib>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
......@@ -44,32 +46,23 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoStdLib>true</NoStdLib>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup Condition=" '$(EnvironmentFlavor)' == 'CLIENTPROFILE' ">
<Reference Include="nunit.framework">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\NUnit\lib\nunit.framework.dll</HintPath>
<Reference Include="xunit.abstractions">
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(EnvironmentFlavor)' != 'CLIENTPROFILE' ">
<Reference Include="Microsoft.Silverlight.Testing, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.Silverlight.Testing.dll</HintPath>
<Reference Include="xunit.assert">
<HintPath>..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\Microsoft.Silverlight.Testing\April2010\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll</HintPath>
<Reference Include="xunit.core">
<HintPath>..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\lib\NUnit-config\Microsoft.VisualStudio.TestTools.cs">
<Link>Microsoft.VisualStudio.TestTools.cs</Link>
</Compile>
<Compile Include="AbstractMessageTest.cs" />
<Compile Include="ByteStringTest.cs" />
<Compile Include="CodedInputStreamTest.cs" />
......@@ -131,28 +124,16 @@
<Name>ProtocolBuffers</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Compatibility\google_message1.dat" />
<EmbeddedResource Include="Compatibility\google_message2.dat" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
......@@ -161,10 +142,11 @@
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup Condition=" '$(EnvironmentFlavor)' == 'CLIENTPROFILE' ">
<StartAction>Program</StartAction>
<StartProgram>$(ProjectDir)..\..\lib\NUnit\tools\nunit-console.exe</StartProgram>
<StartArguments>/nologo /noshadow /labels /wait $(AssemblyName).dll</StartArguments>
<StartWorkingDirectory>$(ProjectDir)$(OutputPath)</StartWorkingDirectory>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props'))" />
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
</Project>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using UnitTest.Issues.TestProtos;
using UnitTest.Issues.TestProtos;
using Xunit;
namespace Google.ProtocolBuffers
{
[TestClass]
public class TestCornerCases
{
[TestMethod]
[Fact]
public void TestRoundTripNegativeEnums()
{
NegativeEnumMessage msg = NegativeEnumMessage.CreateBuilder()
......@@ -23,16 +19,16 @@ namespace Google.ProtocolBuffers
.AddPackedValues(NegativeEnum.FiveBelow) //10
.Build();
Assert.AreEqual(58, msg.SerializedSize);
Assert.Equal(58, msg.SerializedSize);
byte[] bytes = new byte[58];
CodedOutputStream output = CodedOutputStream.CreateInstance(bytes);
msg.WriteTo(output);
Assert.AreEqual(0, output.SpaceLeft);
Assert.Equal(0, output.SpaceLeft);
NegativeEnumMessage copy = NegativeEnumMessage.ParseFrom(bytes);
Assert.AreEqual(msg, copy);
Assert.Equal(msg, copy);
}
}
}
using System;
using System.IO;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Google.ProtocolBuffers.TestProtos;
using Google.ProtocolBuffers.Serialization.Http;
using Xunit;
namespace Google.ProtocolBuffers
{
[TestClass]
public class TestReaderForUrlEncoded
{
[TestMethod]
[Fact]
public void Example_FromQueryString()
{
Uri sampleUri = new Uri("http://sample.com/Path/File.ext?text=two+three%20four&valid=true&numbers=1&numbers=2", UriKind.Absolute);
......@@ -21,14 +20,14 @@ namespace Google.ProtocolBuffers
builder.MergeFrom(input);
TestXmlMessage message = builder.Build();
Assert.AreEqual(true, message.Valid);
Assert.AreEqual("two three four", message.Text);
Assert.AreEqual(2, message.NumbersCount);
Assert.AreEqual(1, message.NumbersList[0]);
Assert.AreEqual(2, message.NumbersList[1]);
Assert.Equal(true, message.Valid);
Assert.Equal("two three four", message.Text);
Assert.Equal(2, message.NumbersCount);
Assert.Equal(1, message.NumbersList[0]);
Assert.Equal(2, message.NumbersList[1]);
}
[TestMethod]
[Fact]
public void Example_FromFormData()
{
Stream rawPost = new MemoryStream(Encoding.UTF8.GetBytes("text=two+three%20four&valid=true&numbers=1&numbers=2"), false);
......@@ -39,46 +38,46 @@ namespace Google.ProtocolBuffers
builder.MergeFrom(input);
TestXmlMessage message = builder.Build();
Assert.AreEqual(true, message.Valid);
Assert.AreEqual("two three four", message.Text);
Assert.AreEqual(2, message.NumbersCount);
Assert.AreEqual(1, message.NumbersList[0]);
Assert.AreEqual(2, message.NumbersList[1]);
Assert.Equal(true, message.Valid);
Assert.Equal("two three four", message.Text);
Assert.Equal(2, message.NumbersCount);
Assert.Equal(1, message.NumbersList[0]);
Assert.Equal(2, message.NumbersList[1]);
}
[TestMethod]
[Fact]
public void TestEmptyValues()
{
ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text=&numbers=1");
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder();
builder.MergeFrom(input);
Assert.IsTrue(builder.Valid);
Assert.IsTrue(builder.HasText);
Assert.AreEqual("", builder.Text);
Assert.AreEqual(1, builder.NumbersCount);
Assert.AreEqual(1, builder.NumbersList[0]);
Assert.True(builder.Valid);
Assert.True(builder.HasText);
Assert.Equal("", builder.Text);
Assert.Equal(1, builder.NumbersCount);
Assert.Equal(1, builder.NumbersList[0]);
}
[TestMethod]
[Fact]
public void TestNoValue()
{
ICodedInputStream input = FormUrlEncodedReader.CreateInstance("valid=true&text&numbers=1");
TestXmlMessage.Builder builder = TestXmlMessage.CreateBuilder();
builder.MergeFrom(input);
Assert.IsTrue(builder.Valid);
Assert.IsTrue(builder.HasText);
Assert.AreEqual("", builder.Text);
Assert.AreEqual(1, builder.NumbersCount);
Assert.AreEqual(1, builder.NumbersList[0]);
Assert.True(builder.Valid);
Assert.True(builder.HasText);
Assert.Equal("", builder.Text);
Assert.Equal(1, builder.NumbersCount);
Assert.Equal(1, builder.NumbersList[0]);
}
[TestMethod, ExpectedException(typeof(NotSupportedException))]
[Fact]
public void FormUrlEncodedReaderDoesNotSupportChildren()
{
ICodedInputStream input = FormUrlEncodedReader.CreateInstance("child=uh0");
TestXmlMessage.CreateBuilder().MergeFrom(input);
Assert.Throws<NotSupportedException>(() => TestXmlMessage.CreateBuilder().MergeFrom(input));
}
}
}
This diff is collapsed.
......@@ -38,17 +38,16 @@ using System.IO;
using System.Reflection;
using Google.ProtocolBuffers.Descriptors;
using Google.ProtocolBuffers.TestProtos;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Xunit;
namespace Google.ProtocolBuffers
{
[TestClass]
public class WireFormatTest
{
/// <summary>
/// Keeps the attributes on FieldType and the switch statement in WireFormat in sync.
/// </summary>
[TestMethod]
[Fact]
public void FieldTypeToWireTypeMapping()
{
foreach (FieldInfo field in typeof(FieldType).GetFields(BindingFlags.Static | BindingFlags.Public))
......@@ -56,34 +55,34 @@ namespace Google.ProtocolBuffers
FieldType fieldType = (FieldType) field.GetValue(null);
FieldMappingAttribute mapping =
(FieldMappingAttribute) field.GetCustomAttributes(typeof(FieldMappingAttribute), false)[0];
Assert.AreEqual(mapping.WireType, WireFormat.GetWireType(fieldType));
Assert.Equal(mapping.WireType, WireFormat.GetWireType(fieldType));
}
}
[TestMethod]
[Fact]
public void Serialization()
{
TestAllTypes message = TestUtil.GetAllSet();
ByteString rawBytes = message.ToByteString();
Assert.AreEqual(rawBytes.Length, message.SerializedSize);
Assert.Equal(rawBytes.Length, message.SerializedSize);
TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes);
TestUtil.AssertAllFieldsSet(message2);
}
[TestMethod]
[Fact]
public void SerializationPacked()
{
TestPackedTypes message = TestUtil.GetPackedSet();
ByteString rawBytes = message.ToByteString();
Assert.AreEqual(rawBytes.Length, message.SerializedSize);
Assert.Equal(rawBytes.Length, message.SerializedSize);
TestPackedTypes message2 = TestPackedTypes.ParseFrom(rawBytes);
TestUtil.AssertPackedFieldsSet(message2);
}
[TestMethod]
[Fact]
public void SerializeExtensions()
{
// TestAllTypes and TestAllExtensions should have compatible wire formats,
......@@ -91,14 +90,14 @@ namespace Google.ProtocolBuffers
// it should work.
TestAllExtensions message = TestUtil.GetAllExtensionsSet();
ByteString rawBytes = message.ToByteString();
Assert.AreEqual(rawBytes.Length, message.SerializedSize);
Assert.Equal(rawBytes.Length, message.SerializedSize);
TestAllTypes message2 = TestAllTypes.ParseFrom(rawBytes);
TestUtil.AssertAllFieldsSet(message2);
}
[TestMethod]
[Fact]
public void SerializePackedExtensions()
{
// TestPackedTypes and TestPackedExtensions should have compatible wire
......@@ -109,10 +108,10 @@ namespace Google.ProtocolBuffers
TestPackedTypes message2 = TestUtil.GetPackedSet();
ByteString rawBytes2 = message2.ToByteString();
Assert.AreEqual(rawBytes, rawBytes2);
Assert.Equal(rawBytes, rawBytes2);
}
[TestMethod]
[Fact]
public void SerializeDelimited()
{
MemoryStream stream = new MemoryStream();
......@@ -124,13 +123,13 @@ namespace Google.ProtocolBuffers
stream.Position = 0;
TestUtil.AssertAllFieldsSet(TestAllTypes.ParseDelimitedFrom(stream));
Assert.AreEqual(12, stream.ReadByte());
Assert.Equal(12, stream.ReadByte());
TestUtil.AssertPackedFieldsSet(TestPackedTypes.ParseDelimitedFrom(stream));
Assert.AreEqual(34, stream.ReadByte());
Assert.AreEqual(-1, stream.ReadByte());
Assert.Equal(34, stream.ReadByte());
Assert.Equal(-1, stream.ReadByte());
}
[TestMethod]
[Fact]
public void ParseExtensions()
{
// TestAllTypes and TestAllExtensions should have compatible wire formats,
......@@ -149,7 +148,7 @@ namespace Google.ProtocolBuffers
TestUtil.AssertAllExtensionsSet(message2);
}
[TestMethod]
[Fact]
public void ParsePackedExtensions()
{
// Ensure that packed extensions can be properly parsed.
......@@ -162,10 +161,10 @@ namespace Google.ProtocolBuffers
TestUtil.AssertPackedExtensionsSet(message2);
}
[TestMethod]
[Fact]
public void ExtensionsSerializedSize()
{
Assert.AreEqual(TestUtil.GetAllSet().SerializedSize, TestUtil.GetAllExtensionsSet().SerializedSize);
Assert.Equal(TestUtil.GetAllSet().SerializedSize, TestUtil.GetAllExtensionsSet().SerializedSize);
}
private static void AssertFieldsInOrder(ByteString data)
......@@ -177,13 +176,13 @@ namespace Google.ProtocolBuffers
string name;
while (input.ReadTag(out tag, out name))
{
Assert.IsTrue(tag > previousTag);
Assert.True(tag > previousTag);
previousTag = tag;
input.SkipField();
}
}
[TestMethod]
[Fact]
public void InterleavedFieldsAndExtensions()
{
// Tests that fields are written in order even when extension ranges
......@@ -214,7 +213,7 @@ namespace Google.ProtocolBuffers
private static readonly int TypeId1 = TestMessageSetExtension1.Descriptor.Extensions[0].FieldNumber;
private static readonly int TypeId2 = TestMessageSetExtension2.Descriptor.Extensions[0].FieldNumber;
[TestMethod]
[Fact]
public void SerializeMessageSet()
{
// Set up a TestMessageSet with two known messages and an unknown one.
......@@ -240,23 +239,23 @@ namespace Google.ProtocolBuffers
// Parse back using RawMessageSet and check the contents.
RawMessageSet raw = RawMessageSet.ParseFrom(data);
Assert.AreEqual(0, raw.UnknownFields.FieldDictionary.Count);
Assert.Equal(0, raw.UnknownFields.FieldDictionary.Count);
Assert.AreEqual(3, raw.ItemCount);
Assert.AreEqual(TypeId1, raw.ItemList[0].TypeId);
Assert.AreEqual(TypeId2, raw.ItemList[1].TypeId);
Assert.AreEqual(UnknownTypeId, raw.ItemList[2].TypeId);
Assert.Equal(3, raw.ItemCount);
Assert.Equal(TypeId1, raw.ItemList[0].TypeId);
Assert.Equal(TypeId2, raw.ItemList[1].TypeId);
Assert.Equal(UnknownTypeId, raw.ItemList[2].TypeId);
TestMessageSetExtension1 message1 = TestMessageSetExtension1.ParseFrom(raw.GetItem(0).Message.ToByteArray());
Assert.AreEqual(123, message1.I);
Assert.Equal(123, message1.I);
TestMessageSetExtension2 message2 = TestMessageSetExtension2.ParseFrom(raw.GetItem(1).Message.ToByteArray());
Assert.AreEqual("foo", message2.Str);
Assert.Equal("foo", message2.Str);
Assert.AreEqual("bar", raw.GetItem(2).Message.ToStringUtf8());
Assert.Equal("bar", raw.GetItem(2).Message.ToStringUtf8());
}
[TestMethod]
[Fact]
public void ParseMessageSet()
{
ExtensionRegistry extensionRegistry = ExtensionRegistry.CreateInstance();
......@@ -295,18 +294,18 @@ namespace Google.ProtocolBuffers
TestMessageSet messageSet =
TestMessageSet.ParseFrom(data, extensionRegistry);
Assert.AreEqual(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I);
Assert.AreEqual("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str);
Assert.Equal(123, messageSet.GetExtension(TestMessageSetExtension1.MessageSetExtension).I);
Assert.Equal("foo", messageSet.GetExtension(TestMessageSetExtension2.MessageSetExtension).Str);
// Check for unknown field with type LENGTH_DELIMITED,
// number UNKNOWN_TYPE_ID, and contents "bar".
UnknownFieldSet unknownFields = messageSet.UnknownFields;
Assert.AreEqual(1, unknownFields.FieldDictionary.Count);
Assert.IsTrue(unknownFields.HasField(UnknownTypeId));
Assert.Equal(1, unknownFields.FieldDictionary.Count);
Assert.True(unknownFields.HasField(UnknownTypeId));
UnknownField field = unknownFields[UnknownTypeId];
Assert.AreEqual(1, field.LengthDelimitedList.Count);
Assert.AreEqual("bar", field.LengthDelimitedList[0].ToStringUtf8());
Assert.Equal(1, field.LengthDelimitedList.Count);
Assert.Equal("bar", field.LengthDelimitedList[0].ToStringUtf8());
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="xunit" version="2.0.0" targetFramework="net45" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.0.0" targetFramework="net45" />
<package id="xunit.core" version="2.0.0" targetFramework="net45" />
<package id="xunit.extensibility.core" version="2.0.0" targetFramework="net45" />
<package id="xunit.runner.visualstudio" version="2.0.0" targetFramework="net45" />
</packages>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="xunit" version="2.0.0" targetFramework="net45" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.0.0" targetFramework="net45" />
<package id="xunit.core" version="2.0.0" targetFramework="net45" />
<package id="xunit.extensibility.core" version="2.0.0" targetFramework="net45" />
<package id="xunit.runner.visualstudio" version="2.0.0" targetFramework="net45" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<repositories>
<repository path="..\ProtocolBuffers.Test\packages.config" />
<repository path="..\ProtocolBuffersLite.Test\packages.config" />
</repositories>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment