aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core.Tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/csharp/Grpc.Core.Tests')
-rw-r--r--src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs7
-rw-r--r--src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs5
2 files changed, 9 insertions, 3 deletions
diff --git a/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs b/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs
index 27c2fa8bf0..259520846f 100644
--- a/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs
+++ b/src/csharp/Grpc.Core.Tests/Internal/CompletionQueueEventTest.cs
@@ -29,9 +29,12 @@ namespace Grpc.Core.Internal.Tests
public class CompletionQueueEventTest
{
[Test]
- public void CreateAndDestroy()
+ public void CompletionQueueEventSizeIsNativeSize()
{
- Assert.AreEqual(CompletionQueueEvent.NativeSize, Marshal.SizeOf<CompletionQueueEvent>());
+ #pragma warning disable 0618
+ // We need to use the obsolete non-generic version of Marshal.SizeOf because the generic version is not available in net45
+ Assert.AreEqual(CompletionQueueEvent.NativeSize, Marshal.SizeOf(typeof(CompletionQueueEvent)));
+ #pragma warning restore 0618
}
}
}
diff --git a/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs b/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs
index c2ece97ba0..be35f31c36 100644
--- a/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs
+++ b/src/csharp/Grpc.Core.Tests/Internal/TimespecTest.cs
@@ -60,7 +60,10 @@ namespace Grpc.Core.Internal.Tests
[Test]
public void TimespecSizeIsNativeSize()
{
- Assert.AreEqual(Timespec.NativeSize, Marshal.SizeOf<Timespec>());
+ #pragma warning disable 0618
+ // We need to use the obsolete non-generic version of Marshal.SizeOf because the generic version is not available in net45
+ Assert.AreEqual(Timespec.NativeSize, Marshal.SizeOf(typeof(Timespec)));
+ #pragma warning restore 0618
}
[Test]