mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-17 01:25:40 -05:00
Add more test cases for code coverage (#127)
Next round of code coverage test cases. Please review the commit for next iteration. * Add connection retry tests * More test coverage * Update diagnostics end-to-end test
This commit is contained in:
@@ -9,6 +9,7 @@ using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.TestDriver.Utility;
|
||||
using Microsoft.SqlTools.ServiceLayer.Workspace.Contracts;
|
||||
using Xunit;
|
||||
@@ -28,7 +29,7 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Tests
|
||||
|
||||
Thread.Sleep(500);
|
||||
|
||||
string query = "SELECT * FROM sys.objects";
|
||||
string query = "SELECT * FROM sys.all_columns c";
|
||||
|
||||
DidOpenTextDocumentNotification openParams = new DidOpenTextDocumentNotification()
|
||||
{
|
||||
@@ -48,6 +49,27 @@ namespace Microsoft.SqlTools.ServiceLayer.TestDriver.Tests
|
||||
Assert.NotNull(queryResult);
|
||||
Assert.NotNull(queryResult.BatchSummaries);
|
||||
|
||||
foreach (var batchSummary in queryResult.BatchSummaries)
|
||||
{
|
||||
foreach (var resultSetSummary in batchSummary.ResultSetSummaries)
|
||||
{
|
||||
Assert.True(resultSetSummary.RowCount > 0);
|
||||
}
|
||||
}
|
||||
|
||||
var subsetRequest = new QueryExecuteSubsetParams()
|
||||
{
|
||||
OwnerUri = ownerUri,
|
||||
BatchIndex = 0,
|
||||
ResultSetIndex = 0,
|
||||
RowsStartIndex = 0,
|
||||
RowsCount = 100,
|
||||
};
|
||||
|
||||
var querySubset = await RequestQueryExecuteSubset(subsetRequest);
|
||||
Assert.NotNull(querySubset);
|
||||
Assert.True(querySubset.ResultSubset.RowCount == 100);
|
||||
|
||||
await Disconnect(ownerUri);
|
||||
}
|
||||
finally
|
||||
|
||||
Reference in New Issue
Block a user