aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/Google.Protobuf.Test
diff options
context:
space:
mode:
authorGravatar Jon Skeet <jonskeet@google.com>2016-07-08 18:21:25 +0100
committerGravatar Jon Skeet <jonskeet@google.com>2016-07-08 18:21:25 +0100
commit3df146e198705dee11de890577f004e42126cd70 (patch)
treea4b23937dcdf49d58966ccd0e8e00d57f4668a68 /csharp/src/Google.Protobuf.Test
parent8b00675fc855c9943733d27bb3b70fa8ba78ffb3 (diff)
Remove unnecessary reflection call
This is the only call to TypeExtensions.IsValueType, so we can remove that method, making the whole type conditionally compiled out for .NET 3.5
Diffstat (limited to 'csharp/src/Google.Protobuf.Test')
-rw-r--r--csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs21
1 files changed, 2 insertions, 19 deletions
diff --git a/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs b/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs
index 359c72c8..f430b06b 100644
--- a/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs
+++ b/csharp/src/Google.Protobuf.Test/Compatibility/TypeExtensionsTest.cs
@@ -34,6 +34,7 @@ using System;
using System.Collections.Generic;
using System.Reflection;
+#if !DOTNET35
namespace Google.Protobuf.Compatibility
{
public class TypeExtensionsTest
@@ -51,24 +52,6 @@ namespace Google.Protobuf.Compatibility
}
[Test]
- [TestCase(typeof(int), true)]
- [TestCase(typeof(int?), true)]
- [TestCase(typeof(Nullable<>), true)]
- [TestCase(typeof(WireFormat.WireType), true)]
- [TestCase(typeof(string), false)]
- [TestCase(typeof(object), false)]
- [TestCase(typeof(Enum), false)]
- [TestCase(typeof(ValueType), false)]
- [TestCase(typeof(TypeExtensionsTest), false)]
- [TestCase(typeof(Action), false)]
- [TestCase(typeof(Action<>), false)]
- [TestCase(typeof(IDisposable), false)]
- public void IsValueType(Type type, bool expected)
- {
- Assert.AreEqual(expected, TypeExtensions.IsValueType(type));
- }
-#if !DOTNET35
- [Test]
[TestCase(typeof(object), typeof(string), true)]
[TestCase(typeof(object), typeof(int), true)]
[TestCase(typeof(string), typeof(string), true)]
@@ -129,6 +112,6 @@ namespace Google.Protobuf.Compatibility
{
Assert.Throws<AmbiguousMatchException>(() => TypeExtensions.GetMethod(type, name));
}
-#endif
}
}
+#endif