summaryrefslogtreecommitdiffstats
path: root/src/test/CppTests/FileDescription.test.ts
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2018-02-25 00:16:04 +0100
committerChristoph Schlosser <christophschlosser@users.noreply.github.com>2018-02-25 01:58:38 +0100
commitb9e681a0b1f2969bce02de8b19be8b589967ff81 (patch)
tree32fa9dbac8b3e52f5bccafa96caaf6053010157f /src/test/CppTests/FileDescription.test.ts
parent041439c5544ca8f9627a922e125dbf7e7ad11769 (diff)
downloaddoxdocgen-b9e681a0b1f2969bce02de8b19be8b589967ff81.tar.gz
Add tests
Diffstat (limited to 'src/test/CppTests/FileDescription.test.ts')
-rw-r--r--src/test/CppTests/FileDescription.test.ts33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/CppTests/FileDescription.test.ts b/src/test/CppTests/FileDescription.test.ts
new file mode 100644
index 0000000..ab6071f
--- /dev/null
+++ b/src/test/CppTests/FileDescription.test.ts
@@ -0,0 +1,33 @@
+//
+// Note: This example test is leveraging the Mocha test framework.
+// Please refer to their documentation on https://mochajs.org/ for help.
+//
+
+// The module 'assert' provides assertion methods from node
+import * as assert from "assert";
+
+// You can import and use all API from the 'vscode' module
+// as well as import your extension to test it
+import * as moment from "moment";
+import * as vscode from "vscode";
+import TestSetup from "./TestSetup";
+
+// Defines a Mocha test suite to group tests of similar kind together
+suite("File Description Tests", () => {
+ const testSetup: TestSetup = new TestSetup("void foo();");
+ const date = moment().format("YYYY-MM-DD");
+
+ // Tests
+ test("#include on next line", () => {
+ const result = testSetup.SetLine("#include <iostream>").GetResult();
+ assert.equal("/**\n * @brief \n * \n * @file MockDocument.h\n * @author your name\n" +
+ " * @date " + date + "\n */", result);
+ });
+
+ test("On first line of document", () => {
+ const result = testSetup.SetLine("").GetResult();
+ assert.equal("/**\n * @brief \n * \n * @file MockDocument.h\n * @author your name\n" +
+ " * @date " + date + "\n */", result);
+ });
+
+});