GetConnectionString API fix to not change the cache only return the value (#1040)

* Get connection string call was changing the connection info (ref object) received from cache. Changing it to just get and make changes to only the returned string..

* Change to ensure PR validation works
This commit is contained in:
Udeesha Gautam
2020-08-09 19:17:16 -07:00
committed by GitHub
parent 81b4bb7753
commit 616a79c83d
3 changed files with 21 additions and 9 deletions

View File

@@ -74,7 +74,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
}
[Test]
public async Task GetCommand([Values]bool includeIdentity, [Values]bool isMemoryOptimized)
public async Task GetCommand([Values]bool includeIdentity, [Values] bool isMemoryOptimized)
{
// Setup:
// ... Create a row delete
@@ -109,7 +109,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
Assert.AreEqual(data.TableMetadata.EscapedMultipartName, tbl);
// ... There should be as many where components as there are keys
string[] whereComponents = m.Groups[2].Value.Split(new[] {"AND"}, StringSplitOptions.None);
string[] whereComponents = m.Groups[2].Value.Split(new[] {"AND" }, StringSplitOptions.None);
Assert.AreEqual(expectedKeys, whereComponents.Length);
Assert.That(whereComponents.Select(c => c.Trim()), Has.All.Match(@"\(.+ = @.+\)"), "Each component should be equal to a parameter");
@@ -193,7 +193,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
Assert.Throws<InvalidOperationException>(() => rd.RevertCell(0));
}
[Fact]
[Test]
public async Task GetVerifyQuery()
{
// Setup: Create a row update and set the first row cell to have values
@@ -228,11 +228,11 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
// ... There should be a table
string tbl = m.Groups[1].Value;
Assert.Equal(data.TableMetadata.EscapedMultipartName, tbl);
Assert.AreEqual(data.TableMetadata.EscapedMultipartName, tbl);
// ... There should be as many where components as there are keys
string[] whereComponents = m.Groups[2].Value.Split(new[] { "AND" }, StringSplitOptions.None);
Assert.Equal(expectedKeys, whereComponents.Length);
Assert.AreEqual(expectedKeys, whereComponents.Length);
// ... Mock db connection for building the command
var mockConn = new TestSqlConnection(new[] { testResultSet });