Skip to content

Commit

Permalink
Added code coverage to refactored code.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmartinezramirez committed Mar 18, 2024
1 parent 1137cf8 commit 5185b34
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Snowflake.Data.Tests/UnitTests/SFSessionPropertyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Snowflake.Data.Tests.UnitTests
{
using System;

class SFSessionPropertyTest
{

Expand Down Expand Up @@ -135,6 +137,36 @@ public static IEnumerable<TestCase> ConnectionStringTestCases()
}
};

var testCaseWithEmptyUserAndPassword = new TestCase()
{
ConnectionString = $"ACCOUNT={defAccount};USER=;PASSWORD=",
ExpectedProperties = new SFSessionProperties()
{
{ SFSessionProperty.ACCOUNT, defAccount },
{ SFSessionProperty.USER, string.Empty },
{ SFSessionProperty.HOST, defHost },
{ SFSessionProperty.AUTHENTICATOR, defAuthenticator },
{ SFSessionProperty.SCHEME, defScheme },
{ SFSessionProperty.CONNECTION_TIMEOUT, defConnectionTimeout },
{ SFSessionProperty.PASSWORD, string.Empty },
{ SFSessionProperty.PORT, defPort },
{ SFSessionProperty.VALIDATE_DEFAULT_PARAMETERS, "true" },
{ SFSessionProperty.USEPROXY, "false" },
{ SFSessionProperty.INSECUREMODE, "false" },
{ SFSessionProperty.DISABLERETRY, "false" },
{ SFSessionProperty.FORCERETRYON404, "false" },
{ SFSessionProperty.CLIENT_SESSION_KEEP_ALIVE, "false" },
{ SFSessionProperty.FORCEPARSEERROR, "false" },
{ SFSessionProperty.BROWSER_RESPONSE_TIMEOUT, defBrowserResponseTime },
{ SFSessionProperty.RETRY_TIMEOUT, defRetryTimeout },
{ SFSessionProperty.MAXHTTPRETRIES, defMaxHttpRetries },
{ SFSessionProperty.INCLUDERETRYREASON, defIncludeRetryReason },
{ SFSessionProperty.DISABLEQUERYCONTEXTCACHE, defDisableQueryContextCache },
{ SFSessionProperty.DISABLE_CONSOLE_LOGIN, defDisableConsoleLogin },
{ SFSessionProperty.ALLOWUNDERSCORESINHOST, defAllowUnderscoresInHost }
}
};

var warehouseWithSpaces = "\"warehouse test\"";
var dbWithQuotes = "\"testdb\"";
var testCaseWithWrappedValuesWithQuotesAndAllowSpaces = new TestCase()
Expand Down Expand Up @@ -472,6 +504,7 @@ public static IEnumerable<TestCase> ConnectionStringTestCases()
return new TestCase[]
{
simpleTestCase,
testCaseWithEmptyUserAndPassword,
testCaseWithWrappedValuesWithQuotesAndAllowSpaces,
testCaseWithBrowserResponseTimeout,
testCaseWithProxySettings,
Expand Down

0 comments on commit 5185b34

Please sign in to comment.