Skip to content

Commit

Permalink
Merge 1ceeacb into ea7ad53
Browse files Browse the repository at this point in the history
  • Loading branch information
benrr101 authored Apr 17, 2024
2 parents ea7ad53 + 1ceeacb commit db130cf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,6 @@ internal static class DbConnectionStringKeywords
internal const string OmitOracleConnectionName = "Omit Oracle Connection Name";

// SqlClient
internal const string TransparentNetworkIPResolution = "Transparent Network IP Resolution";
internal const string Certificate = "Certificate";
#endif
// SqlClient
Expand Down Expand Up @@ -1073,6 +1072,7 @@ internal static class DbConnectionStringKeywords
internal const string IPAddressPreference = "IP Address Preference";
internal const string ServerSPN = "Server SPN";
internal const string FailoverPartnerSPN = "Failover Partner SPN";
internal const string TransparentNetworkIPResolution = "Transparent Network IP Resolution";

// common keywords (OleDb, OracleClient, SqlClient)
internal const string DataSource = "Data Source";
Expand All @@ -1092,10 +1092,9 @@ internal static class DbConnectionStringKeywords

internal static class DbConnectionStringSynonyms
{
#if NETFRAMEWORK
//internal const string TransparentNetworkIPResolution = TRANSPARENTNETWORKIPRESOLUTION;
internal const string TRANSPARENTNETWORKIPRESOLUTION = "transparentnetworkipresolution";
#endif

//internal const string ApplicationName = APP;
internal const string APP = "app";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ private object GetAt(Keywords index)
return MinPoolSize;
case Keywords.MultiSubnetFailover:
return MultiSubnetFailover;
// case Keywords.NamedConnection: return NamedConnection;
case Keywords.PacketSize:
return PacketSize;
case Keywords.Password:
Expand Down Expand Up @@ -912,17 +911,19 @@ public override StandardValuesCollection GetStandardValues(ITypeDescriptorContex
}
}
#else
private static readonly string[] s_notSupportedKeywords = new string[DeprecatedKeywordsCount] {
private static readonly string[] s_notSupportedKeywords = {
DbConnectionStringKeywords.ConnectionReset,
DbConnectionStringKeywords.ContextConnection,
DbConnectionStringKeywords.TransactionBinding,
DbConnectionStringKeywords.TransparentNetworkIPResolution,
DbConnectionStringSynonyms.TRANSPARENTNETWORKIPRESOLUTION,
};

private static readonly string[] s_notSupportedNetworkLibraryKeywords = new string[] {
private static readonly string[] s_notSupportedNetworkLibraryKeywords = {
DbConnectionStringKeywords.NetworkLibrary,

DbConnectionStringSynonyms.NET,
DbConnectionStringSynonyms.NETWORK
DbConnectionStringSynonyms.NETWORK,
};
#endif
#endregion //Private Methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,34 @@ public void ConnectionStringTests(string connectionString)
ExecuteConnectionStringTests(connectionString);
}

public static readonly IEnumerable<object[]> ConnectionStringTestsNetFx_TestCases = new[]
{
new object[] { "Connection Reset = false" },
new object[] { "Context Connection = false" },
new object[] { "Network Library = dbmssocn" },
new object[] { "Network = dbnmpntw" },
new object[] { "Net = dbmsrpcn" },
new object[] { "TransparentNetworkIPResolution = false" },
new object[] { "Transparent Network IP Resolution = true" },
};

[Theory]
[InlineData("Connection Reset = false")]
[InlineData("Context Connection = false")]
[InlineData("Network Library = dbmssocn")]
[InlineData("Network = dbnmpntw")]
[InlineData("Net = dbmsrpcn")]
[InlineData("TransparentNetworkIPResolution = false")]
[InlineData("Transparent Network IP Resolution = true")]
[SkipOnTargetFramework(~TargetFrameworkMonikers.NetFramework)]
public void ConnectionStringTestsNetFx(string connectionString)
[MemberData(nameof(ConnectionStringTestsNetFx_TestCases))]
#if NETFRAMEWORK
public void ConnectionStringTestsNetFx_OnNetFx_Success(string connectionString)
{
ExecuteConnectionStringTests(connectionString);
}
#else
public void ConnectionStringTestsNetFx_OnNetCore_Throws(string connectionString)
{
// Act
Action action = () => _ = new SqlConnectionStringBuilder(connectionString);

// Assert
Assert.Throws<NotSupportedException>(action);
}
#endif

[Fact]
public void SetInvalidApplicationIntent_Throws()
Expand Down

0 comments on commit db130cf

Please sign in to comment.