package com.avg.zaap.crashlibrary.crashlibmocks;

import android.app.Application;
import android.content.ComponentName;
import android.content.Intent;

import java.io.File;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

/**
 * Fake parent class for unit tests {@link com.avg.zaap.crashlibrary.CrashLibTests}.
 */
public class CrashLibTestsParentFake extends Application {

    public static final File MOCK_FILE = mock(File.class);
    public static final Intent MOCK_INTENT = mock(Intent.class);

    private static final ComponentName MOCK_COMPONENT_NAME = mock(ComponentName.class);

    public int startServiceCounter = 0;

    static {
        when(MOCK_FILE.getAbsolutePath()).thenReturn("foo");
    }

    @Override
    public ComponentName startService(Intent service) {
        startServiceCounter++;
        return MOCK_COMPONENT_NAME;
    }

    @Override
    public File getFilesDir() {
        return MOCK_FILE;
    }

}
