本文整理汇总了TypeScript中vs/workbench/parts/experiments/electron-browser/experimentalPrompt.ExperimentalPrompts.getPromptText方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ExperimentalPrompts.getPromptText方法的具体用法?TypeScript ExperimentalPrompts.getPromptText怎么用?TypeScript ExperimentalPrompts.getPromptText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/workbench/parts/experiments/electron-browser/experimentalPrompt.ExperimentalPrompts
的用法示例。
在下文中一共展示了ExperimentalPrompts.getPromptText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test('Test getPromptText', () => {
const simpleTextCase: IExperimentActionPromptProperties = {
promptText: 'My simple prompt',
commands: []
};
const multipleLocaleCase: IExperimentActionPromptProperties = {
promptText: {
en: 'My simple prompt for en',
de: 'My simple prompt for de',
'en-au': 'My simple prompt for Austrailian English',
'en-us': 'My simple prompt for US English'
},
commands: []
};
const englishUSTextCase: IExperimentActionPromptProperties = {
promptText: {
'en-us': 'My simple prompt for en'
},
commands: []
};
const noEnglishTextCase: IExperimentActionPromptProperties = {
promptText: {
'de-de': 'My simple prompt for German'
},
commands: []
};
assert.equal(ExperimentalPrompts.getPromptText(simpleTextCase, 'any-language'), simpleTextCase.promptText);
assert.equal(ExperimentalPrompts.getPromptText(multipleLocaleCase, 'en'), multipleLocaleCase.promptText['en']);
assert.equal(ExperimentalPrompts.getPromptText(multipleLocaleCase, 'de'), multipleLocaleCase.promptText['de']);
assert.equal(ExperimentalPrompts.getPromptText(multipleLocaleCase, 'en-au'), multipleLocaleCase.promptText['en-au']);
assert.equal(ExperimentalPrompts.getPromptText(multipleLocaleCase, 'en-gb'), multipleLocaleCase.promptText['en']);
assert.equal(ExperimentalPrompts.getPromptText(multipleLocaleCase, 'fr'), multipleLocaleCase.promptText['en']);
assert.equal(ExperimentalPrompts.getPromptText(englishUSTextCase, 'fr'), englishUSTextCase.promptText['en-us']);
assert.equal(!!ExperimentalPrompts.getPromptText(noEnglishTextCase, 'fr'), false);
});