本文整理汇总了TypeScript中vs/workbench/common/storage.Storage.getInteger方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Storage.getInteger方法的具体用法?TypeScript Storage.getInteger怎么用?TypeScript Storage.getInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/workbench/common/storage.Storage
的用法示例。
在下文中一共展示了Storage.getInteger方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test('Get Data, Integer, Boolean', () => {
let context = new TestContextService();
let s = new Storage(new InMemoryLocalStorage(), null, context);
assert.strictEqual(s.get('Monaco.IDE.Core.Storage.Test.get', StorageScope.GLOBAL, 'foobar'), 'foobar');
assert.strictEqual(s.get('Monaco.IDE.Core.Storage.Test.get', StorageScope.GLOBAL, ''), '');
assert.strictEqual(s.get('Monaco.IDE.Core.Storage.Test.getInteger', StorageScope.GLOBAL, 5), 5);
assert.strictEqual(s.get('Monaco.IDE.Core.Storage.Test.getInteger', StorageScope.GLOBAL, 0), 0);
assert.strictEqual(s.get('Monaco.IDE.Core.Storage.Test.getBoolean', StorageScope.GLOBAL, true), true);
assert.strictEqual(s.get('Monaco.IDE.Core.Storage.Test.getBoolean', StorageScope.GLOBAL, false), false);
s.store('Monaco.IDE.Core.Storage.Test.get', 'foobar');
assert.strictEqual(s.get('Monaco.IDE.Core.Storage.Test.get'), 'foobar');
s.store('Monaco.IDE.Core.Storage.Test.get', '');
assert.strictEqual(s.get('Monaco.IDE.Core.Storage.Test.get'), '');
s.store('Monaco.IDE.Core.Storage.Test.getInteger', 5);
assert.strictEqual(s.getInteger('Monaco.IDE.Core.Storage.Test.getInteger'), 5);
s.store('Monaco.IDE.Core.Storage.Test.getInteger', 0);
assert.strictEqual(s.getInteger('Monaco.IDE.Core.Storage.Test.getInteger'), 0);
s.store('Monaco.IDE.Core.Storage.Test.getBoolean', true);
assert.strictEqual(s.getBoolean('Monaco.IDE.Core.Storage.Test.getBoolean'), true);
s.store('Monaco.IDE.Core.Storage.Test.getBoolean', false);
assert.strictEqual(s.getBoolean('Monaco.IDE.Core.Storage.Test.getBoolean'), false);
assert.strictEqual(s.get('Monaco.IDE.Core.Storage.Test.getDefault', StorageScope.GLOBAL, 'getDefault'), 'getDefault');
assert.strictEqual(s.getInteger('Monaco.IDE.Core.Storage.Test.getIntegerDefault', StorageScope.GLOBAL, 5), 5);
assert.strictEqual(s.getBoolean('Monaco.IDE.Core.Storage.Test.getBooleanDefault', StorageScope.GLOBAL, true), true);
});
示例2: test
test("Get Data, Integer, Boolean", () => {
let context = new TestContextService();
let s = new Storage(context, new InMemoryLocalStorage());
assert.strictEqual(s.get("Monaco.IDE.Core.Storage.Test.get", StorageScope.GLOBAL, "foobar"), "foobar");
assert.strictEqual(s.get("Monaco.IDE.Core.Storage.Test.get", StorageScope.GLOBAL, ""), "");
assert.strictEqual(s.get("Monaco.IDE.Core.Storage.Test.getInteger", StorageScope.GLOBAL, 5), 5);
assert.strictEqual(s.get("Monaco.IDE.Core.Storage.Test.getInteger", StorageScope.GLOBAL, 0), 0);
assert.strictEqual(s.get("Monaco.IDE.Core.Storage.Test.getBoolean", StorageScope.GLOBAL, true), true);
assert.strictEqual(s.get("Monaco.IDE.Core.Storage.Test.getBoolean", StorageScope.GLOBAL, false), false);
s.store("Monaco.IDE.Core.Storage.Test.get", "foobar");
assert.strictEqual(s.get("Monaco.IDE.Core.Storage.Test.get"), "foobar");
s.store("Monaco.IDE.Core.Storage.Test.get", "");
assert.strictEqual(s.get("Monaco.IDE.Core.Storage.Test.get"), "");
s.store("Monaco.IDE.Core.Storage.Test.getInteger", 5);
assert.strictEqual(s.getInteger("Monaco.IDE.Core.Storage.Test.getInteger"), 5);
s.store("Monaco.IDE.Core.Storage.Test.getInteger", 0);
assert.strictEqual(s.getInteger("Monaco.IDE.Core.Storage.Test.getInteger"), 0);
s.store("Monaco.IDE.Core.Storage.Test.getBoolean", true);
assert.strictEqual(s.getBoolean("Monaco.IDE.Core.Storage.Test.getBoolean"), true);
s.store("Monaco.IDE.Core.Storage.Test.getBoolean", false);
assert.strictEqual(s.getBoolean("Monaco.IDE.Core.Storage.Test.getBoolean"), false);
assert.strictEqual(s.get("Monaco.IDE.Core.Storage.Test.getDefault", StorageScope.GLOBAL, "getDefault"), "getDefault");
assert.strictEqual(s.getInteger("Monaco.IDE.Core.Storage.Test.getIntegerDefault", StorageScope.GLOBAL, 5), 5);
assert.strictEqual(s.getBoolean("Monaco.IDE.Core.Storage.Test.getBooleanDefault", StorageScope.GLOBAL, true), true);
});