-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increased code coverage for connection pool and review suggestions
- Loading branch information
1 parent
beca66b
commit 259e67a
Showing
8 changed files
with
116 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Snowflake.Data.Tests/UnitTests/ConnectionPoolManagerSwitchTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using NUnit.Framework; | ||
using Snowflake.Data.Client; | ||
using Snowflake.Data.Core.Session; | ||
|
||
namespace Snowflake.Data.Tests.UnitTests | ||
{ | ||
public class ConnectionPoolManagerSwitchTest | ||
{ | ||
private readonly string _connectionString1 = "database=D1;warehouse=W1;account=A1;user=U1;password=P1;role=R1;"; | ||
private readonly string _connectionString2 = "database=D2;warehouse=W2;account=A2;user=U2;password=P2;role=R2;"; | ||
|
||
[Test] | ||
public void TestRevertPoolToPreviousVersion() | ||
{ | ||
SnowflakeDbConnectionPool.SetOldConnectionPoolVersion(); | ||
|
||
var sessionPool1 = SnowflakeDbConnectionPool.GetPool(_connectionString1); | ||
var sessionPool2 = SnowflakeDbConnectionPool.GetPool(_connectionString2); | ||
Assert.AreEqual(ConnectionPoolType.SingleConnectionCache, SnowflakeDbConnectionPool.GetConnectionPoolVersion()); | ||
Assert.AreEqual(sessionPool1, sessionPool2); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.