Schema Compare tests for utils (#10759)

* Added a few tests for utils file under Schema Compare

* Addressed comment- moved mock test data to a common location
This commit is contained in:
Sakshi Sharma
2020-06-08 10:44:16 -07:00
committed by GitHub
parent 3e5421dc43
commit 06590ad0a2
4 changed files with 119 additions and 39 deletions

View File

@@ -0,0 +1,55 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as mssql from '../../../mssql';
// Mock test data
export const mockConnectionProfile: azdata.IConnectionProfile = {
connectionName: 'My Connection',
serverName: 'My Server',
databaseName: 'My Database',
userName: 'My User',
password: 'My Pwd',
authenticationType: 'SqlLogin',
savePassword: false,
groupFullName: 'My groupName',
groupId: 'My GroupId',
providerName: 'My Provider',
saveProfile: true,
id: 'My Id',
options: null
};
export const mockConnectionInfo = {
options: {},
serverName: 'My Server',
databaseName: 'My Database',
userName: 'My User',
password: 'My Pwd',
authenticationType: 'SqlLogin'
};
export const mockFilePath: string = 'test.dacpac';
export const mockDacpacEndpoint: mssql.SchemaCompareEndpointInfo = {
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
serverDisplayName: '',
serverName: '',
databaseName: '',
ownerUri: '',
packageFilePath: mockFilePath,
connectionDetails: undefined
};
export const mockDatabaseEndpoint: mssql.SchemaCompareEndpointInfo = {
endpointType: mssql.SchemaCompareEndpointType.Database,
serverDisplayName: '',
serverName: '',
databaseName: '',
ownerUri: '',
packageFilePath: '',
connectionDetails: undefined
};