diff --git a/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts b/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts index 42edd7dddd46b6ac2d2857bff6a371c05a75876b..78054e7dfa355ce6908f98d5d0bc85cbaede9a57 100644 --- a/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts +++ b/src/vs/workbench/services/configurationResolver/test/electron-browser/configurationResolverService.test.ts @@ -12,19 +12,19 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/electron-browser/configurationResolverService'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { TestEnvironmentService, TestEditorService, TestContextService } from 'vs/workbench/test/workbenchTestServices'; +import { TestEnvironmentService, TestNextEditorService, TestContextService } from 'vs/workbench/test/workbenchTestServices'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; suite('Configuration Resolver Service', () => { let configurationResolverService: IConfigurationResolverService; let envVariables: { [key: string]: string } = { key1: 'Value for key1', key2: 'Value for key2' }; let mockCommandService: MockCommandService; - let editorService: TestEditorService; + let editorService: TestNextEditorService; let workspace: IWorkspaceFolder; setup(() => { mockCommandService = new MockCommandService(); - editorService = new TestEditorService(); + editorService = new TestNextEditorService(); workspace = { uri: uri.parse('file:///VSCode/workspaceLocation'), name: 'hey', @@ -115,7 +115,7 @@ suite('Configuration Resolver Service', () => { } }); - let service = new ConfigurationResolverService(envVariables, new TestEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); + let service = new ConfigurationResolverService(envVariables, new TestNextEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); assert.strictEqual(service.resolve(workspace, 'abc ${config:editor.fontFamily} xyz'), 'abc foo xyz'); }); @@ -132,7 +132,7 @@ suite('Configuration Resolver Service', () => { } }); - let service = new ConfigurationResolverService(envVariables, new TestEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); + let service = new ConfigurationResolverService(envVariables, new TestNextEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); assert.strictEqual(service.resolve(workspace, 'abc ${config:editor.fontFamily} ${config:terminal.integrated.fontFamily} xyz'), 'abc foo bar xyz'); }); @@ -149,7 +149,7 @@ suite('Configuration Resolver Service', () => { } }); - let service = new ConfigurationResolverService(envVariables, new TestEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); + let service = new ConfigurationResolverService(envVariables, new TestNextEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); if (platform.isWindows) { assert.strictEqual(service.resolve(workspace, 'abc ${config:editor.fontFamily} ${workspaceFolder} ${env:key1} xyz'), 'abc foo \\VSCode\\workspaceLocation Value for key1 xyz'); } else { @@ -170,7 +170,7 @@ suite('Configuration Resolver Service', () => { } }); - let service = new ConfigurationResolverService(envVariables, new TestEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); + let service = new ConfigurationResolverService(envVariables, new TestNextEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); if (platform.isWindows) { assert.strictEqual(service.resolve(workspace, '${config:editor.fontFamily} ${config:terminal.integrated.fontFamily} ${workspaceFolder} - ${workspaceFolder} ${env:key1} - ${env:key2}'), 'foo bar \\VSCode\\workspaceLocation - \\VSCode\\workspaceLocation Value for key1 - Value for key2'); } else { @@ -204,7 +204,7 @@ suite('Configuration Resolver Service', () => { } }); - let service = new ConfigurationResolverService(envVariables, new TestEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); + let service = new ConfigurationResolverService(envVariables, new TestNextEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); assert.strictEqual(service.resolve(workspace, 'abc ${config:editor.fontFamily} ${config:editor.lineNumbers} ${config:editor.insertSpaces} xyz'), 'abc foo 123 false xyz'); }); @@ -214,7 +214,7 @@ suite('Configuration Resolver Service', () => { editor: {} }); - let service = new ConfigurationResolverService(envVariables, new TestEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); + let service = new ConfigurationResolverService(envVariables, new TestNextEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); assert.strictEqual(service.resolve(workspace, 'abc ${unknownVariable} xyz'), 'abc ${unknownVariable} xyz'); assert.strictEqual(service.resolve(workspace, 'abc ${env:unknownVariable} xyz'), 'abc xyz'); }); @@ -227,7 +227,7 @@ suite('Configuration Resolver Service', () => { } }); - let service = new ConfigurationResolverService(envVariables, new TestEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); + let service = new ConfigurationResolverService(envVariables, new TestNextEditorService(), TestEnvironmentService, configurationService, mockCommandService, new TestContextService()); assert.throws(() => service.resolve(workspace, 'abc ${env} xyz')); assert.throws(() => service.resolve(workspace, 'abc ${env:} xyz')); diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index eb888cbb47b98e07611a76114dd1d5ebb3c1af5e..62b4d93c30993951fd1e30b57eaaceb434ec2dec 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -871,6 +871,8 @@ export class TestNextEditorService implements INextEditorService { visibleControls: ReadonlyArray = []; visibleTextEditorControls = []; visibleEditors: ReadonlyArray = []; + public mockLineNumber = 15; + public mockSelectedText = 'selected text'; openEditor(editor: any, options?: any, group?: any) { return TPromise.as(null);