package org.tomighty.plugin;

import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import org.junit.Test;

import static org.junit.Assert.assertSame;

public class DefaultPluginTest {

    //TODO test getPluginName
    //TODO test getPluginVersion
    //TODO test getMenuItem

    @Test
    public void testInjectorIsTheSameUsedToCreateThePlugin() {
        Injector injector = Guice.createInjector(new AbstractModule() {
            @Override
            protected void configure() {
                bind(Plugin.class).to(DefaultPlugin.class);
            }
        });

        Plugin plugin = injector.getInstance(Plugin.class);

        assertSame(injector, plugin.getInjector());
    }

}

@@ -152,14 +152,82 @@
 nit.
-Test;%0A
+Before;%0Aimport org.junit.Test;%0A%0Aimport static org.junit.Assert.assertNull;
 %0Aimp
@@ -309,105 +309,74 @@
     
-//TODO test getPluginName%0A    //TODO test getPluginVersion%0A    //TODO test getMenuItem
+private Plugin plugin;%0A    private Injector injector;
 %0A%0A    @
-Test
+Before
 %0A   
@@ -392,50 +392,13 @@
 oid 
-testInjectorIsTheSameUsedToCreateThePlugin
+setUp
 () %7B
@@ -406,25 +406,16 @@
         
-Injector 
 injector
@@ -619,23 +619,16 @@
         
-Plugin 
 plugin =
@@ -664,16 +664,256 @@
 class);%0A
+    %7D%0A%0A    //TODO test getPluginName%0A    //TODO test getPluginVersion%0A%0A    @Test%0A    public void testHasNoMenuItem() %7B%0A        assertNull(plugin.getMenuItem());%0A    %7D%0A%0A    @Test%0A    public void testInjectorIsTheSameUsedToCreateThePlugin() %7B
 %0A       

Test menu item returned by the default plugin.