From 7b75239b14685ca5af16ed60b712584232a13eb5 Mon Sep 17 00:00:00 2001 From: cheptsov Date: Thu, 28 Feb 2013 17:29:33 +0400 Subject: [PATCH] Tests for commenter --- tests/com/simpleplugin/SimpleCodeInsightTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/com/simpleplugin/SimpleCodeInsightTest.java b/tests/com/simpleplugin/SimpleCodeInsightTest.java index e820558e1..5874da196 100644 --- a/tests/com/simpleplugin/SimpleCodeInsightTest.java +++ b/tests/com/simpleplugin/SimpleCodeInsightTest.java @@ -1,6 +1,7 @@ package com.simpleplugin; import com.intellij.codeInsight.completion.CompletionType; +import com.intellij.codeInsight.generation.actions.CommentByLineCommentAction; import com.intellij.openapi.application.ApplicationManager; import com.intellij.psi.PsiElement; import com.intellij.psi.codeStyle.CodeStyleManager; @@ -54,4 +55,13 @@ public class SimpleCodeInsightTest extends LightCodeInsightFixtureTestCase { myFixture.renameElementAtCaret("websiteUrl"); myFixture.checkResultByFile("RenameTestData.simple", "RenameTestDataAfter.simple", false); } + + public void testCommenter() { + myFixture.configureByText(SimpleFileType.INSTANCE, "website = http://en.wikipedia.org/"); + CommentByLineCommentAction commentAction = new CommentByLineCommentAction(); + commentAction.actionPerformedImpl(getProject(), myFixture.getEditor()); + myFixture.checkResult("#website = http://en.wikipedia.org/"); + commentAction.actionPerformedImpl(getProject(), myFixture.getEditor()); + myFixture.checkResult("website = http://en.wikipedia.org/"); + } } \ No newline at end of file