mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 10:58:31 -05:00
Tests for Schema Compare utils file (#10822)
* Introduced ApiWrapper for testability * Added tests for coverage of utils.ts * Addressed comments
This commit is contained in:
@@ -3,22 +3,22 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { Disposable, ExtensionContext } from 'vscode';
|
||||
import { SchemaCompareMainWindow } from '../schemaCompareMainWindow';
|
||||
import { ApiWrapper } from '../common/apiWrapper';
|
||||
|
||||
/**
|
||||
* The main controller class that initializes the extension
|
||||
*/
|
||||
export default class MainController implements vscode.Disposable {
|
||||
protected _context: vscode.ExtensionContext;
|
||||
export default class MainController implements Disposable {
|
||||
protected schemaCompareMainWindow: SchemaCompareMainWindow;
|
||||
|
||||
public constructor(context: vscode.ExtensionContext) {
|
||||
this._context = context;
|
||||
public constructor(private context: ExtensionContext, private apiWrapper: ApiWrapper) {
|
||||
this.schemaCompareMainWindow = new SchemaCompareMainWindow(this.apiWrapper, null, this.extensionContext);
|
||||
}
|
||||
|
||||
public get extensionContext(): vscode.ExtensionContext {
|
||||
return this._context;
|
||||
public get extensionContext(): ExtensionContext {
|
||||
return this.context;
|
||||
}
|
||||
|
||||
public deactivate(): void {
|
||||
@@ -30,7 +30,7 @@ export default class MainController implements vscode.Disposable {
|
||||
}
|
||||
|
||||
private initializeSchemaCompareDialog(): void {
|
||||
vscode.commands.registerCommand('schemaCompare.start', (context: any) => new SchemaCompareMainWindow(null, this.extensionContext).start(context));
|
||||
this.apiWrapper.registerCommand('schemaCompare.start', (context: any) => this.schemaCompareMainWindow.start(context));
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
|
||||
Reference in New Issue
Block a user