Allow empty query string text (#415)

* Allow empty query string text

* Remove test that is no longer valid

* Remove test that is no longer valid
This commit is contained in:
Karl Burtram
2017-07-15 10:14:32 -07:00
committed by GitHub
parent b20529cced
commit 18977a89dc
4 changed files with 2 additions and 38 deletions

View File

@@ -35,17 +35,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.QueryExecution.Execution
Assert.Throws<InvalidOperationException>(() => query.BatchSummaries);
}
[Fact]
public void QueryExecuteNoQueryText()
{
// If:
// ... I create a query that has a null query text
// Then:
// ... It should throw an exception
Assert.Throws<ArgumentException>(() =>
new Query(null, Common.CreateTestConnectionInfo(null, false), new QueryExecutionSettings(), MemoryFileSystem.GetFileStreamFactory()));
}
[Fact]
public void QueryExecuteNoConnectionInfo()
{

View File

@@ -396,31 +396,6 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.QueryExecution.Execution
Assert.Equal(1, queryService.ActiveQueries.Count);
}
[Fact]
public async Task QueryExecuteMissingSelectionTest()
{
// Given:
// ... A workspace with a standard query is configured
var workspaceService = Common.GetPrimedWorkspaceService(string.Empty);
// If:
// ... I request to execute a query with a missing query string
var queryService = Common.GetPrimedExecutionService(null, true, false, workspaceService);
var queryParams = new ExecuteDocumentSelectionParams { OwnerUri = Constants.OwnerUri, QuerySelection = null};
var efv = new EventFlowValidator<ExecuteRequestResult>()
.AddStandardErrorValidation()
.Complete();
await queryService.HandleExecuteRequest(queryParams, efv.Object);
// Then:
// ... Am error should have been sent
efv.Validate();
// ... There should not be an active query
Assert.Empty(queryService.ActiveQueries);
}
[Fact]
public async Task QueryExecuteInvalidQueryTest()
{