From ef2e8c5d451188bceaeaa262b49d86081f775098 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Fri, 2 Mar 2018 19:31:23 +0100 Subject: Add tests for new smart text --- src/test/CppTests/Config.test.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/test/CppTests/Config.test.ts') diff --git a/src/test/CppTests/Config.test.ts b/src/test/CppTests/Config.test.ts index d37f93d..ee6a90f 100644 --- a/src/test/CppTests/Config.test.ts +++ b/src/test/CppTests/Config.test.ts @@ -114,4 +114,29 @@ suite("C++ - Configuration Tests", () => { const result = testSetup.SetLine("~Foo();").GetResult(); assert.equal("/**\n * @brief Test Foo\n * \n */", result); }); + + test("Custom smart text getter", () => { + testSetup.cfg.C.getterText = "Test {name}"; + const result = testSetup.SetLine("int getFoo();").GetResult(); + assert.equal("/**\n * @brief Test Foo\n * \n * @return int \n */", result); + }); + + test("Custom smart text setter", () => { + testSetup.cfg.C.setterText = "Test {name}"; + const result = testSetup.SetLine("void setFoo(int foo);").GetResult(); + assert.equal("/**\n * @brief Test Foo\n * \n * @param foo \n */", result); + }); + + test("Custom smart text factory method", () => { + testSetup.cfg.C.factoryMethodText = "Test {name}"; + const result = testSetup.SetLine("int createFoo();").GetResult(); + assert.equal("/**\n * @brief Test Foo\n * \n * @return int \n */", result); + }); + + test("Don't split casing for smart text", () => { + testSetup.cfg.C.factoryMethodText = "Test {name}"; + testSetup.cfg.Generic.splitCasingSmartText = false; + const result = testSetup.SetLine("int createFooObject();").GetResult(); + assert.equal("/**\n * @brief Test FooObject\n * \n * @return int \n */", result); + }); }); -- cgit v1.2.3