From d4f1889ec216f4328212b4c21a91c6f5662dd38a Mon Sep 17 00:00:00 2001 From: Tugberk Ugurlu Date: Mon, 30 Jan 2017 22:56:00 +0000 Subject: [PATCH] catch correct exception --- .../Common/MongoDbServerTestUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/AspNetCore.Identity.MongoDB.Tests/Common/MongoDbServerTestUtils.cs b/tests/AspNetCore.Identity.MongoDB.Tests/Common/MongoDbServerTestUtils.cs index 95e309e..a2583c9 100644 --- a/tests/AspNetCore.Identity.MongoDB.Tests/Common/MongoDbServerTestUtils.cs +++ b/tests/AspNetCore.Identity.MongoDB.Tests/Common/MongoDbServerTestUtils.cs @@ -28,7 +28,7 @@ public void Dispose() { _mongoTestServer.Dispose(); } - catch(ObjectDisposedException) + catch(AggregateException ex) when(ex.GetBaseException().GetType() == typeof(ObjectDisposedException)) { /* It's for some reason, disposing MongoTestServer can give us ObjectDisposedException. I have only