summaryrefslogtreecommitdiffstats
path: root/src/test/TestSetup.ts
diff options
context:
space:
mode:
authorRowan Goemans <RB.Goemans@student.han.nl>2017-12-28 21:00:30 +0100
committerChristoph Schlosser <christophschlosser@users.noreply.github.com>2018-02-20 22:02:22 +0100
commit5b0912d99732536ae18d3c70730cc6df2ed3af24 (patch)
tree865a574c2639aa76bb088edbd4e4dd11926f8b4b /src/test/TestSetup.ts
parent0192f188aa8df79bbc7a2cec7a7e3f4bd0d70417 (diff)
downloaddoxdocgen-5b0912d99732536ae18d3c70730cc6df2ed3af24.tar.gz
-- Implemented support for all operators except the conversion operator.
-- Implemented support for noexcept and throw. -- Implemented support for constexpr. -- Implemented support for multiple template specifications. -- Rewritten some unit tests. -- Fixed bug where unnamed parameters weren't recognized properly -- Fixed bug where namespace with template params weren't being parsed correctly.
Diffstat (limited to 'src/test/TestSetup.ts')
-rw-r--r--src/test/TestSetup.ts46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/test/TestSetup.ts b/src/test/TestSetup.ts
new file mode 100644
index 0000000..2f4f64a
--- /dev/null
+++ b/src/test/TestSetup.ts
@@ -0,0 +1,46 @@
+import * as vscode from "vscode";
+import CodeParser from "../CodeParser/CodeParser";
+import CParser from "../CodeParser/CParser/CParser";
+import { IDocGen } from "../DocGen/DocGen";
+import * as myExtension from "../extension";
+import MockDocument from "./MockDocument";
+import MockEditor from "./MockEditor";
+import MockLine from "./MockLine";
+import MockPosition from "./MockPosition";
+import MockSelection from "./MockSelection";
+
+export default class TestSetup {
+ private editor: MockEditor;
+
+ constructor(method: string) {
+ this.SetMethod(method);
+ }
+
+ public SetMethod(method: string): TestSetup {
+ let position: MockPosition;
+ position = new MockPosition(0, 0);
+
+ let selection: MockSelection;
+ selection = new MockSelection(position);
+
+ let line: MockLine;
+ line = new MockLine(method);
+
+ let doc: MockDocument;
+ doc = new MockDocument(line);
+
+ this.editor = new MockEditor(selection, doc);
+
+ return this;
+ }
+
+ public GetResult(): string {
+ let parser: CodeParser;
+ parser = new CParser();
+
+ const gen: IDocGen = parser.Parse(this.editor);
+ gen.GenerateDoc(new vscode.Range(new vscode.Position(0, 0), new vscode.Position(0, 0)));
+
+ return this.editor.editBuilder.text;
+ }
+}