reorganize answer placeholder actions
[idea/community.git] / python / educational-core / course-creator / testSrc / com / jetbrains / edu / coursecreator / actions / CCAnswerPlaceholderActionTest.java
index d7c9a8fbc5b8b242bae40c8b3787423573db418d..ba28df0f981777661f6c80a9bb66b3d758b6e3fa 100644 (file)
@@ -1,5 +1,6 @@
 package com.jetbrains.edu.coursecreator.actions;
 
+import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.Presentation;
 import com.intellij.openapi.command.undo.UndoManager;
 import com.intellij.openapi.fileEditor.FileEditorManager;
@@ -8,6 +9,7 @@ import com.intellij.openapi.vfs.VirtualFile;
 import com.jetbrains.edu.coursecreator.CCTestCase;
 import com.jetbrains.edu.coursecreator.CCTestsUtil;
 import com.jetbrains.edu.coursecreator.actions.placeholder.CCAddAnswerPlaceholder;
+import com.jetbrains.edu.coursecreator.actions.placeholder.CCDeleteAnswerPlaceholder;
 import com.jetbrains.edu.learning.StudyUtils;
 import com.jetbrains.edu.learning.courseFormat.AnswerPlaceholder;
 import com.jetbrains.edu.learning.courseFormat.TaskFile;
@@ -40,11 +42,11 @@ public class CCAnswerPlaceholderActionTest extends CCTestCase {
   }
 
   public void testPlaceholderWithSelection() {
-    doTest("onePlaceholder");
+    doTest("onePlaceholder", new CCTestAction());
   }
 
   public void testPlaceholderWithoutSelection() {
-    doTest("withoutSelection");
+    doTest("withoutSelection", new CCTestAction());
   }
 
   public void testPlaceholderIntersection() {
@@ -54,12 +56,12 @@ public class CCAnswerPlaceholderActionTest extends CCTestCase {
   }
 
   public void testPlaceholderDeleted() {
-    doTest("deletePlaceholder");
+    doTest("deletePlaceholder", new CCDeleteAnswerPlaceholder());
   }
 
-  private void doTest(String name) {
+  private void doTest(String name, AnAction action) {
     VirtualFile virtualFile = configureByTaskFile(name + CCTestsUtil.BEFORE_POSTFIX);
-    myFixture.testAction(new CCTestAction());
+    myFixture.testAction(action);
     TaskFile taskFile = StudyUtils.getTaskFile(getProject(), virtualFile);
     checkByFile(taskFile, name + CCTestsUtil.AFTER_POSTFIX, false);
     checkHighlighters(taskFile, myFixture.getEditor().getMarkupModel());