Remove references to query model service in query code (#6513)

* remove references of query model service from query code

* fix tests

* clean up the code
This commit is contained in:
Anthony Dresser
2019-08-03 01:26:58 -07:00
committed by GitHub
parent 62d2fb534d
commit 674351dc75
12 changed files with 113 additions and 201 deletions

View File

@@ -14,6 +14,7 @@ import { URI } from 'vs/base/common/uri';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
import { TestEditorService } from 'vs/workbench/test/workbenchTestServices';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
suite('TaskUtilities', function () {
test('getCurrentGlobalConnection returns the selected OE server if a server or one of its children is selected', () => {
@@ -76,7 +77,8 @@ suite('TaskUtilities', function () {
// Mock the workbench service to return the active tab connection
let tabConnectionUri = 'file://test_uri';
let editorInput = new UntitledEditorInput(URI.parse(tabConnectionUri), false, undefined, undefined, undefined, undefined, undefined, undefined);
let queryInput = new QueryInput(undefined, editorInput, undefined, undefined, undefined, undefined, undefined);
const instantiationService = new TestInstantiationService();
let queryInput = new QueryInput(undefined, editorInput, undefined, undefined, undefined, instantiationService);
mockConnectionManagementService.setup(x => x.getConnectionProfile(tabConnectionUri)).returns(() => tabProfile);
// If I call getCurrentGlobalConnection, it should return the expected profile from the active tab