aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs')
-rw-r--r--src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs b/src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs
index 4fdfab5a99..78295cf6d4 100644
--- a/src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs
+++ b/src/csharp/Grpc.Core.Tests/GrpcEnvironmentTest.cs
@@ -53,7 +53,7 @@ namespace Grpc.Core.Tests
{
var env1 = GrpcEnvironment.AddRef();
var env2 = GrpcEnvironment.AddRef();
- Assert.IsTrue(object.ReferenceEquals(env1, env2));
+ Assert.AreSame(env1, env2);
GrpcEnvironment.Release();
GrpcEnvironment.Release();
}
@@ -61,18 +61,21 @@ namespace Grpc.Core.Tests
[Test]
public void InitializeAfterShutdown()
{
+ Assert.AreEqual(0, GrpcEnvironment.GetRefCount());
+
var env1 = GrpcEnvironment.AddRef();
GrpcEnvironment.Release();
var env2 = GrpcEnvironment.AddRef();
GrpcEnvironment.Release();
- Assert.IsFalse(object.ReferenceEquals(env1, env2));
+ Assert.AreNotSame(env1, env2);
}
[Test]
public void ReleaseWithoutAddRef()
{
+ Assert.AreEqual(0, GrpcEnvironment.GetRefCount());
Assert.Throws(typeof(InvalidOperationException), () => GrpcEnvironment.Release());
}