Skip to content

Commit

Permalink
Fix test for disabling new pool
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-knozderko committed Nov 21, 2023
1 parent 26bf0d9 commit 9be3464
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions Snowflake.Data.Tests/UnitTests/ConnectionPoolManagerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Exception>(() => _connectionPoolManager.SetPooling(false));

// Assert
Assert.AreEqual(true, sessionPool1.GetPooling());
Assert.IsNotNull(thrown);
}

[Test]
Expand Down

0 comments on commit 9be3464

Please sign in to comment.