diff --git a/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts b/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts index 1b8b94b15da28322a8d4011e1b1ca767e25628c3..9f3c2925716896dda482ce872ea92d2053f24fb3 100644 --- a/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts +++ b/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts @@ -18,10 +18,12 @@ 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; setup(() => { mockCommandService = new MockCommandService(); - configurationResolverService = new ConfigurationResolverService(uri.parse('file:///VSCode/workspaceLocation'), envVariables, new TestEditorService(), TestEnvironmentService, new TestConfigurationService(), mockCommandService); + editorService = new TestEditorService(); + configurationResolverService = new ConfigurationResolverService(uri.parse('file:///VSCode/workspaceLocation'), envVariables, editorService, TestEnvironmentService, new TestConfigurationService(), mockCommandService); }); teardown(() => { @@ -42,7 +44,7 @@ suite('Configuration Resolver Service', () => { }); test('current selected line number', () => { - assert.strictEqual(configurationResolverService.resolve('abc ${lineNumber} xyz'), 'abc 15 xyz'); + assert.strictEqual(configurationResolverService.resolve('abc ${lineNumber} xyz'), `abc ${editorService.mockLineNumber} xyz`); }); test('substitute many', () => { diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index a574451b0c0da81806733e68693980a0ba0d62f8..fe7b87be2644c9b9315e0c78bdab4b60a136484b 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -468,11 +468,13 @@ export class TestEditorService implements IWorkbenchEditorService { public activeEditorInput: IEditorInput; public activeEditorOptions: IEditorOptions; public activeEditorPosition: Position; + public mockLineNumber: number; private callback: (method: string) => void; constructor(callback?: (method: string) => void) { this.callback = callback || ((s: string) => { }); + this.mockLineNumber = 15; } public openEditors(inputs): Promise { @@ -505,7 +507,7 @@ export class TestEditorService implements IWorkbenchEditorService { getId: () => { return null; }, getControl: () => { return { - getSelection: () => { return { positionLineNumber: 15 }; } + getSelection: () => { return { positionLineNumber: this.mockLineNumber }; } }; }, focus: () => { },