diff options
| author | Christoph Schlosser <thisisagap@gmail.com> | 2017-12-08 17:22:57 +0100 |
|---|---|---|
| committer | Christoph Schlosser <christophschlosser@users.noreply.github.com> | 2017-12-16 21:48:09 +0100 |
| commit | 86595e38975f902d061df4a1e60783bfb725ad2f (patch) | |
| tree | d51eca8c52cba6bac8f3e1d13fcd53cee3d5d7ef /src/test/MockDocument.ts | |
| parent | ab3a71d958273915512f5da948ef73c8b5ac26d8 (diff) | |
| download | doxdocgen-86595e38975f902d061df4a1e60783bfb725ad2f.tar.gz | |
Add basic tests
Diffstat (limited to 'src/test/MockDocument.ts')
| -rw-r--r-- | src/test/MockDocument.ts | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/test/MockDocument.ts b/src/test/MockDocument.ts new file mode 100644 index 0000000..447adc9 --- /dev/null +++ b/src/test/MockDocument.ts @@ -0,0 +1,51 @@ +import * as vscode from "vscode"; +import MockLine from "./MockLine"; + +export default class MockDocument implements vscode.TextDocument { + public uri: vscode.Uri; + public fileName: string; + public isUntitled: boolean; + public languageId: string; + public version: number; + public isDirty: boolean; + public isClosed: boolean; + public eol: vscode.EndOfLine; + public lineCount: number; + private line: vscode.TextLine; + private firstCall: boolean; + public constructor(line: vscode.TextLine) { + this.line = line; + this.firstCall = true; + } + public save(): Thenable<boolean> { + throw new Error("Method not implemented."); + } + public lineAt(line: number | vscode.Position): vscode.TextLine; + public lineAt(position: any): any { + if (this.firstCall) { + this.firstCall = false; + return this.line; + } else { + return new MockLine(";"); + } + } + public offsetAt(position: vscode.Position): number { + throw new Error("Method not implemented."); + } + public positionAt(offset: number): vscode.Position { + throw new Error("Method not implemented."); + } + public getText(range?: vscode.Range): string { + throw new Error("Method not implemented."); + } + public getWordRangeAtPosition(position: vscode.Position, regex?: RegExp): vscode.Range { + throw new Error("Method not implemented."); + } + public validateRange(range: vscode.Range): vscode.Range { + throw new Error("Method not implemented."); + } + public validatePosition(position: vscode.Position): vscode.Position { + throw new Error("Method not implemented."); + } + +} |