<NME> ElmIntentionTestBase.kt
<BEF> ADDFILE
<MSG> Implement 'Add Import' intention (#14)

Fixes #2 
<DFF> @@ -0,0 +1,29 @@
+/*
+ * Use of this source code is governed by the MIT license that can be
+ * found in the LICENSE file.
+ *
+ * From intellij-rust
+ */
+
+package org.elm.ide.intentions
+
+import com.intellij.codeInsight.intention.IntentionAction
+import org.elm.lang.ElmTestBase
+import org.intellij.lang.annotations.Language
+
+
+abstract class ElmIntentionTestBase(val intention: IntentionAction) : ElmTestBase() {
+
+    protected fun doAvailableTest(@Language("Rust") before: String, @Language("Rust") after: String) {
+        InlineFile(before).withCaret()
+        myFixture.launchAction(intention)
+        myFixture.checkResult(replaceCaretMarker(after))
+    }
+
+    protected fun doUnavailableTest(@Language("Rust") before: String) {
+        InlineFile(before).withCaret()
+        check(intention.familyName !in myFixture.availableIntentions.mapNotNull { it.familyName }) {
+            "\"$intention\" intention should not be available"
+        }
+    }
+}
\ No newline at end of file

Implement 'Add Import' intention (#14)