aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/test-utilities/storage.mock.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-04-13 13:03:18 +0800
committercrupest <crupest@outlook.com>2019-04-13 13:03:18 +0800
commit72890735ced2edc8ccecfed811393e951de5c091 (patch)
tree39cf181a18a3dc443dbab5669a04d0a23cdefd00 /Timeline/ClientApp/src/app/test-utilities/storage.mock.ts
parent19cae15eba2bcede41b818e1b8ab7fd5ac92eb05 (diff)
downloadtimeline-72890735ced2edc8ccecfed811393e951de5c091.tar.gz
timeline-72890735ced2edc8ccecfed811393e951de5c091.tar.bz2
timeline-72890735ced2edc8ccecfed811393e951de5c091.zip
Init separate.
Diffstat (limited to 'Timeline/ClientApp/src/app/test-utilities/storage.mock.ts')
-rw-r--r--Timeline/ClientApp/src/app/test-utilities/storage.mock.ts28
1 files changed, 0 insertions, 28 deletions
diff --git a/Timeline/ClientApp/src/app/test-utilities/storage.mock.ts b/Timeline/ClientApp/src/app/test-utilities/storage.mock.ts
deleted file mode 100644
index 0ba5aa35..00000000
--- a/Timeline/ClientApp/src/app/test-utilities/storage.mock.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { Mock } from './mock';
-import { nullIfUndefined } from '../utilities/language-untilities';
-
-export function createMockStorage(): Mock<Storage> {
- const map: { [key: string]: string } = {};
- return {
- get length(): number {
- return Object.keys(map).length;
- },
- key(index: number): string | null {
- const keys = Object.keys(map);
- if (index >= keys.length) { return null; }
- return keys[index];
- },
- clear() {
- Object.keys(map).forEach(key => delete map.key);
- },
- getItem(key: string): string | null {
- return nullIfUndefined(map[key]);
- },
- setItem(key: string, value: string) {
- map[key] = value;
- },
- removeItem(key: string) {
- delete map[key];
- }
- };
-}