Swapping Record usage to Map in SQL Projects (#22758)

* Changing SqlCmdVars from Record to Map

* Converting the rest

* Updating tests

* more cleanup

* Updating test to use new test creation API
This commit is contained in:
Benjin Dubishar
2023-04-17 12:56:39 -07:00
committed by GitHub
parent 4a4580e9ef
commit 02e61d1598
21 changed files with 132 additions and 138 deletions

View File

@@ -49,8 +49,8 @@ describe('Publish profile tests', function (): void {
const result = await load(vscode.Uri.file(profilePath), testContext.dacFxService.object);
should(result.databaseName).equal('targetDb');
should(Object.keys(result.sqlCmdVariables).length).equal(1);
should(result.sqlCmdVariables['ProdDatabaseName']).equal('MyProdDatabase');
should(result.sqlCmdVariables.size).equal(1);
should(result.sqlCmdVariables.get('ProdDatabaseName')).equal('MyProdDatabase');
should(result.connectionId).equal('connId');
should(result.connection).equal('testserver (default)');
should(result.options).equal(mockDacFxOptionsResult.deploymentOptions);
@@ -74,8 +74,8 @@ describe('Publish profile tests', function (): void {
const result = await load(vscode.Uri.file(profilePath), testContext.dacFxService.object);
should(result.databaseName).equal('targetDb');
should(Object.keys(result.sqlCmdVariables).length).equal(1);
should(result.sqlCmdVariables['ProdDatabaseName']).equal('MyProdDatabase');
should(result.sqlCmdVariables.size).equal(1);
should(result.sqlCmdVariables.get('ProdDatabaseName')).equal('MyProdDatabase');
should(result.connectionId).equal('connId');
should(result.connection).equal('testserver (testUser)');
should(result.options).equal(mockDacFxOptionsResult.deploymentOptions);
@@ -89,10 +89,10 @@ describe('Publish profile tests', function (): void {
});
const result = await load(vscode.Uri.file(profilePath), testContext.dacFxService.object);
should(Object.keys(result.sqlCmdVariables).length).equal(1);
should(result.sqlCmdVariables.size).equal(1);
// the profile has both Value and DefaultValue, but Value should be the one used
should(result.sqlCmdVariables['ProdDatabaseName']).equal('MyProdDatabase');
should(result.sqlCmdVariables.get('ProdDatabaseName')).equal('MyProdDatabase');
});
it('Should throw error when connecting does not work', async function (): Promise<void> {