|
@@ -4,6 +4,8 @@ import { assert } from 'chai';
|
|
|
|
|
|
import { ServiceIdentifiers } from '../../../src/container/ServiceIdentifiers';
|
|
import { ServiceIdentifiers } from '../../../src/container/ServiceIdentifiers';
|
|
|
|
|
|
|
|
+import { TDictionary } from '../../../src/types/TDictionary';
|
|
|
|
+
|
|
import { IInversifyContainerFacade } from '../../../src/interfaces/container/IInversifyContainerFacade';
|
|
import { IInversifyContainerFacade } from '../../../src/interfaces/container/IInversifyContainerFacade';
|
|
import { IMapStorage } from '../../../src/interfaces/storages/IMapStorage';
|
|
import { IMapStorage } from '../../../src/interfaces/storages/IMapStorage';
|
|
import { IOptions } from '../../../src/interfaces/options/IOptions';
|
|
import { IOptions } from '../../../src/interfaces/options/IOptions';
|
|
@@ -212,6 +214,25 @@ describe('MapStorage', () => {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ describe('getStorageAsDictionary', () => {
|
|
|
|
+ const expectedDictionary: TDictionary<string> = {
|
|
|
|
+ [storageKey]: storageValue
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ let storageAsDictionary: TDictionary<string>;
|
|
|
|
+
|
|
|
|
+ before(() => {
|
|
|
|
+ storage = getStorageInstance<string>();
|
|
|
|
+ storage.set(storageKey, storageValue);
|
|
|
|
+
|
|
|
|
+ storageAsDictionary = storage.getStorageAsDictionary();
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ it('should return storage as dictionary', () => {
|
|
|
|
+ assert.deepEqual(storageAsDictionary, expectedDictionary);
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
describe('has', () => {
|
|
describe('has', () => {
|
|
describe('Variant #1: item is presenting in storage', () => {
|
|
describe('Variant #1: item is presenting in storage', () => {
|
|
const expectedItemExistence: boolean = true;
|
|
const expectedItemExistence: boolean = true;
|