Files
azuredatastudio/src/sql/platform/connection/test/common/testConnectionProvider.ts
Alex Ma 82648fab3e connection tests for connectionDialogWidget (#11160)
* Added providerRegistered test

* test for EditConnectionDialog

* changed wording

* added test for connectionInfo

* utils.ts tests added

* hasRegisteredServers test

* commented out editconnection tests, addl. tests

* added onConnectionChangedNotification test

* added changeGroupId tests

* Added connection  profile changes

* added connectIfNotConnected test

* added delete connection test

* isRecent and disconnect editor tests

* Add CodeQL Analysis workflow (#10195)

* Add CodeQL Analysis workflow

* Fix path

* added registerIconProvider test

* Fix for ensureDefaultLanguageFlavor test

* added a few tests

* utils prefix test updated

* added utils tests

* disconnect tests added

* Added additional get connection info tests

* added some more tests

* minor additions to tests

* again another commit

* another change

* connectionManagementService finalized

* connectionDialogWidget test WIP

* wip connectiondialogwidget test

* added working connectionDialogWidget test

* added more tests

* current connectionDialogWidget tests

* undid space

* hanging promise addressed

* added open test

* finished connectionDialogWidget tests

* Added showDialog test

* mockConnectionDialogService added

* added accessorConnectionDialogService

* removed accessor service

* added openDialogAndWait test

* added fake error to test

* added error tests

* Added comments to test

* more coverage

* async to await change

* registerCapabilities test added

* connectionDialogService tests finished

* undefined added

* Added views for tests

* tslint disable added

* error catchers added

* added empty connectioninfo

Co-authored-by: Justin Hutchings <jhutchings1@users.noreply.github.com>
2020-09-30 08:39:54 -07:00

56 lines
1.8 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* 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 { mssqlProviderName } from 'sql/platform/connection/common/constants';
export class TestConnectionProvider implements azdata.ConnectionProvider {
public readonly providerId = mssqlProviderName;
connect(connectionUri: string, connectionInfo: azdata.ConnectionInfo): Thenable<boolean> {
return Promise.resolve(true);
}
disconnect(connectionUri: string): Thenable<boolean> {
return Promise.resolve(true);
}
cancelConnect(connectionUri: string): Thenable<boolean> {
return Promise.resolve(true);
}
listDatabases(connectionUri: string): Thenable<azdata.ListDatabasesResult> {
return Promise.resolve({ databaseNames: [] });
}
changeDatabase(connectionUri: string, newDatabase: string): Thenable<boolean> {
return Promise.resolve(true);
}
getConnectionString(connectionUri: string, includePassword?: boolean): Thenable<string> {
return Promise.resolve('');
}
buildConnectionInfo(connectionString: string): Thenable<azdata.ConnectionInfo> {
return Promise.resolve({ options: {} });
}
rebuildIntelliSenseCache(connectionUri: string): Thenable<void> {
return Promise.resolve();
}
registerOnConnectionComplete(handler: (connSummary: azdata.ConnectionInfoSummary) => any) {
return undefined;
}
registerOnIntelliSenseCacheComplete(handler: (connectionUri: string) => any) {
return undefined;
}
registerOnConnectionChanged(handler: (changedConnInfo: azdata.ChangedConnectionInfo) => any) {
return undefined;
}
}