Fix for multiple parameter error. (#1082)

* Clearing first use of parameters

* restore space

* added finally block

* Added try catch block in correct position

* fixed spacing

* added space before try

* duplicate row check simplified by Alan

* Revert "duplicate row check simplified by Alan"

This reverts commit 445ac506bd96b353266778abd0cf9bad2be2a3c3.

* removed exception and changed message

* added exception back for test purposes

* added working executescalar

* Added "<=" for delete action that deletes nothing.

* spacing fix for check duplicate

* Added comments and changed function logic.

* added clarifying message

* Added new extended class

* small space fix
This commit is contained in:
Alex Ma
2020-09-25 10:52:59 -07:00
committed by GitHub
parent fd4d067e71
commit 47e7a2f492
3 changed files with 90 additions and 23 deletions

View File

@@ -83,7 +83,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
RowDelete rd = new RowDelete(0, rs, data.TableMetadata);
// ... Mock db connection for building the command
var mockConn = new TestSqlConnection(null);
var mockConn = new TestEditDataSqlConnection(null);
// If: I attempt to get a command for the edit
DbCommand cmd = rd.GetCommand(mockConn);
@@ -235,7 +235,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
Assert.AreEqual(expectedKeys, whereComponents.Length);
// ... Mock db connection for building the command
var mockConn = new TestSqlConnection(new[] { testResultSet });
var mockConn = new TestEditDataSqlConnection(new[] { testResultSet });
// If: I attempt to get a command for a simulated delete of a row with duplicates.
// Then: The Command will throw an exception as it detects there are