提交 19a9898b 编写于 作者: I isidor

configuratoin resover service fix build errors

上级 732bd8d8
......@@ -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'));
......
......@@ -871,6 +871,8 @@ export class TestNextEditorService implements INextEditorService {
visibleControls: ReadonlyArray<IEditor> = [];
visibleTextEditorControls = [];
visibleEditors: ReadonlyArray<IEditorInput> = [];
public mockLineNumber = 15;
public mockSelectedText = 'selected text';
openEditor(editor: any, options?: any, group?: any) {
return TPromise.as(null);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册