本文整理匯總了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);
});