package com.mobify.astro.plugins.loaders;

import com.mobify.astro.ActivityTestBase;
import com.mobify.astro.PluginResolver;

import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;

public abstract class LoaderPluginTestCase<T extends LoaderPlugin> extends ActivityTestBase {

    T loader;
    PluginResolver mockPluginResolver;

    protected abstract T buildPlugin();

    @Before
    public void setUp() {
        mockPluginResolver = mock(PluginResolver.class);

        // Ask subclass to build the loader plugin to test
        loader = buildPlugin();
    }

    @Test
    public void testCanGetView() {
        assertTrue(loader.getView() != null);
    }

    @Test
    public void testCanStart() {
        // simple "doest not throw" type test
        loader.start();
    }

    @Test
    public void testCanStop() {
        // simple "doest not throw" type test
        loader.stop();
    }
}
