mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
fixed the issue with defualt values for options not loaded correctly (#581)
This commit is contained in:
@@ -691,7 +691,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the value of ScriptIndexes Property
|
/// Returns the value of ScriptIndexes Property
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool? DriIndexes { get { return ScriptOptions.ScriptIndexes; } }
|
public bool? Indexes { get { return ScriptOptions.ScriptIndexes; } }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -75,7 +75,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
|||||||
UrnCollection urns = CreateUrns(ServerConnection);
|
UrnCollection urns = CreateUrns(ServerConnection);
|
||||||
ScriptingOptions options = new ScriptingOptions();
|
ScriptingOptions options = new ScriptingOptions();
|
||||||
SetScriptBehavior(options);
|
SetScriptBehavior(options);
|
||||||
PopulateAdvancedScriptOptions(this.Parameters.ScriptOptions, options);
|
ScriptAsOptions scriptAsOptions = new ScriptAsOptions(this.Parameters.ScriptOptions);
|
||||||
|
PopulateAdvancedScriptOptions(scriptAsOptions, options);
|
||||||
options.WithDependencies = false;
|
options.WithDependencies = false;
|
||||||
// TODO: Not including the header by default. We have to get this option from client
|
// TODO: Not including the header by default. We have to get this option from client
|
||||||
options.IncludeHeaders = false;
|
options.IncludeHeaders = false;
|
||||||
|
|||||||
@@ -89,7 +89,14 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
|||||||
[Fact]
|
[Fact]
|
||||||
public async void VerifyScriptAsCreateTable()
|
public async void VerifyScriptAsCreateTable()
|
||||||
{
|
{
|
||||||
string query = "CREATE TABLE testTable1 (c1 int)";
|
string query = @"CREATE TABLE testTable1 (c1 int)
|
||||||
|
GO
|
||||||
|
CREATE CLUSTERED INDEX [ClusteredIndex-1] ON [dbo].[testTable1]
|
||||||
|
(
|
||||||
|
[c1] ASC
|
||||||
|
)
|
||||||
|
GO
|
||||||
|
";
|
||||||
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Create;
|
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Create;
|
||||||
ScriptingObject scriptingObject = new ScriptingObject
|
ScriptingObject scriptingObject = new ScriptingObject
|
||||||
{
|
{
|
||||||
@@ -97,9 +104,10 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
|||||||
Schema = "dbo",
|
Schema = "dbo",
|
||||||
Type = "Table"
|
Type = "Table"
|
||||||
};
|
};
|
||||||
string expectedScript = "CREATE TABLE [dbo].[testTable1]";
|
List<string> expectedScripts = new List<string> { "CREATE TABLE [dbo].[testTable1]", "CREATE CLUSTERED INDEX [ClusteredIndex-1] ON [dbo].[testTable1]" };
|
||||||
|
|
||||||
await VerifyScriptAs(query, scriptingObject, scriptCreateDrop, expectedScript);
|
|
||||||
|
await VerifyScriptAsForMultipleObjects(query, new List<ScriptingObject> { scriptingObject }, scriptCreateDrop, expectedScripts);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
Reference in New Issue
Block a user