From 9be3464292be493581a0005d5c1ba3a0f6de849e Mon Sep 17 00:00:00 2001 From: Krzysztof Nozderko Date: Tue, 21 Nov 2023 18:06:14 +0100 Subject: [PATCH] Fix test for disabling new pool --- .../UnitTests/ConnectionPoolManagerTest.cs | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/Snowflake.Data.Tests/UnitTests/ConnectionPoolManagerTest.cs b/Snowflake.Data.Tests/UnitTests/ConnectionPoolManagerTest.cs index a28a3754c..7ba249ebf 100644 --- a/Snowflake.Data.Tests/UnitTests/ConnectionPoolManagerTest.cs +++ b/Snowflake.Data.Tests/UnitTests/ConnectionPoolManagerTest.cs @@ -2,6 +2,7 @@ * Copyright (c) 2023 Snowflake Computing Inc. All rights reserved. */ +using System; using System.Collections.Generic; using System.Security; using System.Threading; @@ -160,30 +161,16 @@ public void TestSetTimeoutForAllPools() } [Test] - public void TestSetPoolingDisabledForAllPools() + public void TestSetPoolingDisabledForAllPoolsNotPossible() { // Arrange - var sessionPool1 = _connectionPoolManager.GetPool(ConnectionString1, _password); + _connectionPoolManager.GetPool(ConnectionString1, _password); // Act - _connectionPoolManager.SetPooling(false); - - // Assert - Assert.AreEqual(false, sessionPool1.GetPooling()); - } - - [Test] - public void TestSetPoolingEnabledBack() - { - // Arrange - var sessionPool1 = _connectionPoolManager.GetPool(ConnectionString1, _password); - _connectionPoolManager.SetPooling(false); - - // Act - _connectionPoolManager.SetPooling(true); + var thrown = Assert.Throws(() => _connectionPoolManager.SetPooling(false)); // Assert - Assert.AreEqual(true, sessionPool1.GetPooling()); + Assert.IsNotNull(thrown); } [Test]