Removing ApiWrapper and adding sinon (#11340)

* Added sinon
removed api wrapper
removed unnecesaary utils

* merged from testfix

* merged from aasim/import/downloadTestFix

* merge from aasim/import/downloadTestFix
This commit is contained in:
Aasim Khan
2020-07-14 14:53:18 -07:00
committed by GitHub
parent cabbbb56f2
commit 24f6cd2e5b
19 changed files with 212 additions and 322 deletions

View File

@@ -11,22 +11,18 @@ import { FlatFileWizard } from '../wizard/flatFileWizard';
import { ServiceClient } from '../services/serviceClient';
import { ApiType, managerInstance } from '../services/serviceApiManager';
import { FlatFileProvider } from '../services/contracts';
import { ApiWrapper } from '../common/apiWrapper';
/**
* The main controller class that initializes the extension
*/
export default class MainController extends ControllerBase {
private _outputChannel: vscode.OutputChannel;
private _apiWrapper: ApiWrapper;
public constructor(
context: vscode.ExtensionContext,
apiWrapper: ApiWrapper
) {
super(context);
this._apiWrapper = apiWrapper;
this._outputChannel = this._apiWrapper.createOutputChannel(constants.serviceName);
this._outputChannel = vscode.window.createOutputChannel(constants.serviceName);
}
/**
*/
@@ -39,13 +35,13 @@ export default class MainController extends ControllerBase {
this.initializeFlatFileProvider(provider);
resolve(true);
});
await new ServiceClient(this._outputChannel, this._apiWrapper).startService(this._context);
await new ServiceClient(this._outputChannel).startService(this._context);
});
}
private initializeFlatFileProvider(provider: FlatFileProvider) {
this._apiWrapper.registerTask(constants.flatFileImportStartCommand, (profile: azdata.IConnectionProfile, ...args: any[]) => new FlatFileWizard(provider, this._apiWrapper).start(profile, args));
azdata.tasks.registerTask(constants.flatFileImportStartCommand, (profile: azdata.IConnectionProfile, ...args: any[]) => new FlatFileWizard(provider).start(profile, args));
}
}