Execute SQL statement at cursor location (#412)

* Stage changes to other machine

* Parse sql statement from script document

* Fix a few typos and minor changes

* Fix bug
This commit is contained in:
Karl Burtram
2017-07-13 20:33:05 -07:00
committed by GitHub
parent 005fc9e4df
commit cfa78bbc3b
4 changed files with 140 additions and 25 deletions

View File

@@ -21,6 +21,20 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.QueryExecution.Execution
#region Get SQL Tests
[Fact]
public void ExecuteDocumentStatementTest()
{
string query = string.Format("{0}{1}GO{1}{0}", Constants.StandardQuery, Environment.NewLine);
var workspaceService = GetDefaultWorkspaceService(query);
var queryService = new QueryExecutionService(null, workspaceService);
var queryParams = new ExecuteDocumentStatementParams { OwnerUri = Constants.OwnerUri, Line = 0, Column = 0 };
var queryText = queryService.GetSqlText(queryParams);
// The text should match the standard query
Assert.Equal(queryText, Constants.StandardQuery);
}
[Fact]
public void GetSqlTextFromDocumentRequestFull()
{