mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 09:59:48 -05:00
Add Scripter class and use it in the ScriptingService (#286)
* Initial scripting commit * Fix the script CREATE integration test * Use language service binding queue for scripting * Update scripting service to have methods for each operation * Add scripter class * Fix build break. * Fix a few bugs * Use scripter class instead of PeekDefinition class. * Fix scripting test break * Fix header incorrectly saying file is generated. * Add localization tests to address a large block of code not covered by automation. * Moving system usings to top of using list
This commit is contained in:
@@ -20,8 +20,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
/// </summary>
|
||||
public class ScriptingServiceTests
|
||||
{
|
||||
private const string SchemaName = "sys";
|
||||
private const string TableName = "all_objects";
|
||||
private const string SchemaName = "dbo";
|
||||
private const string TableName = "spt_monitor";
|
||||
|
||||
private LiveConnectionHelper.TestConnectionResult GetLiveAutoCompleteTestObjects()
|
||||
{
|
||||
@@ -49,12 +49,12 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
|
||||
var scriptingParams = new ScriptingScriptAsParams
|
||||
{
|
||||
OwnerUri = Test.Common.Constants.OwnerUri,
|
||||
OwnerUri = result.ConnectionInfo.OwnerUri,
|
||||
Operation = operation,
|
||||
Metadata = new ObjectMetadata()
|
||||
{
|
||||
MetadataType = MetadataType.Table,
|
||||
MetadataTypeName = "View",
|
||||
MetadataTypeName = "Table",
|
||||
Schema = SchemaName,
|
||||
Name = TableName
|
||||
}
|
||||
@@ -62,11 +62,6 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
|
||||
await ScriptingService.HandleScriptingScriptAsRequest(scriptingParams, requestContext.Object);
|
||||
|
||||
requestContext.Verify(x => x.SendResult(It.Is<ScriptingScriptAsResult>(
|
||||
i => i.Script.Contains(operation.ToString().ToUpper())
|
||||
&& i.Script.Contains(TableName)
|
||||
&& i.Script.Contains(SchemaName))));
|
||||
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user