summaryrefslogtreecommitdiffstats
path: root/src/test/tools/MockDocument.ts
diff options
context:
space:
mode:
authorRowan Goemans <RB.Goemans@student.han.nl>2018-01-01 21:22:18 +0100
committerChristoph Schlosser <christophschlosser@users.noreply.github.com>2018-02-20 22:02:22 +0100
commit8711b0fb2c8f88a6864096de7813e63fd6cf9f7a (patch)
tree212fd2fb67cfd2f778e42ae955f869bc444afdb2 /src/test/tools/MockDocument.ts
parentd9cef62f8778fcdc39d26802d5d7457c97e9dfc0 (diff)
downloaddoxdocgen-8711b0fb2c8f88a6864096de7813e63fd6cf9f7a.tar.gz
-- Added tests for the configuration options.
-- Expanded the mock classes to allow for more dynamic setting of the contents.
Diffstat (limited to 'src/test/tools/MockDocument.ts')
-rw-r--r--src/test/tools/MockDocument.ts15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/test/tools/MockDocument.ts b/src/test/tools/MockDocument.ts
index cb6bbfe..781dbfe 100644
--- a/src/test/tools/MockDocument.ts
+++ b/src/test/tools/MockDocument.ts
@@ -11,24 +11,19 @@ export default class MockDocument implements vscode.TextDocument {
public isClosed: boolean;
public eol: vscode.EndOfLine;
public lineCount: number;
- private line: vscode.TextLine;
- private callCount: number;
- public constructor(line: vscode.TextLine) {
- this.line = line;
- this.callCount = 0;
+ private lines: vscode.TextLine[];
+ public constructor(lines: vscode.TextLine[]) {
+ this.lines = lines;
}
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.callCount === 1) {
- return new MockLine("");
- } else if (this.callCount === 2) {
- return this.line;
- } else {
+ if (position >= this.lines.length) {
return new MockLine(";");
}
+ return this.lines[position];
}
public offsetAt(position: vscode.Position): number {
throw new Error("Method not implemented.");