diff options
| author | Rowan Goemans <RB.Goemans@student.han.nl> | 2017-12-31 02:03:08 +0100 |
|---|---|---|
| committer | Christoph Schlosser <christophschlosser@users.noreply.github.com> | 2018-02-20 22:02:22 +0100 |
| commit | 1746f21bc3720585d2fe877db8d69aae301ff02c (patch) | |
| tree | 7f0d081fd8fc3e0b54c7bb478cb8724a4cf3b798 /src/test/tools/TestSetup.ts | |
| parent | b446b9e596fc0487b88597d8e818dae61512f309 (diff) | |
| download | doxdocgen-1746f21bc3720585d2fe877db8d69aae301ff02c.tar.gz | |
-- Added many unit tests for the C parser. Almost complete now
-- Refactored project structure to allow for more overview once we add more languages.
-- Renamed a lot of types in the CParser to be more explicit.
-- Made configuration injectable into the classes that need them. This allows to unit test configuration variables.
-- Added 2 new config params that allows to customize what gets returned for a bool return type.
-- Small changes to the logic to make it more concise.
Diffstat (limited to 'src/test/tools/TestSetup.ts')
| -rw-r--r-- | src/test/tools/TestSetup.ts | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/test/tools/TestSetup.ts b/src/test/tools/TestSetup.ts deleted file mode 100644 index 1270616..0000000 --- a/src/test/tools/TestSetup.ts +++ /dev/null @@ -1,46 +0,0 @@ -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.SetLine(method); - } - - public SetLine(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; - } -} |