// Path: app/src/main/java/com/hitherejoe/androidtvboilerplate/data/DataManager.java
// @Singleton
// public class DataManager {
// 
//     private final AndroidTvBoilerplateService mTvAndroidTvBoilerplateService;
//     private final PreferencesHelper mPreferencesHelper;
// 
//     @Inject
//     public DataManager(PreferencesHelper preferencesHelper,
//                        AndroidTvBoilerplateService androidTvBoilerplateService) {
//         mPreferencesHelper = preferencesHelper;
//         mTvAndroidTvBoilerplateService = androidTvBoilerplateService;
//     }
// 
//     public PreferencesHelper getPreferencesHelper() {
//         return mPreferencesHelper;
//     }
// 
//     public Single<List<Cat>> getCats(List<Cat> cats) {
//         // This just for example, usually here we'd make an API request and not pass a useless
//         // list of cats back that we passed in!
//         return Single.just(cats);
//     }
// 
// }
// 
// Path: app/src/main/java/com/hitherejoe/androidtvboilerplate/data/local/PreferencesHelper.java
// @Singleton
// public class PreferencesHelper {
// 
//     private final SharedPreferences mPref;
// 
//     public static final String PREF_FILE_NAME = "tv_boilerplate_pref_file";
//     private static final String PREF_KEY_ACCESS_TOKEN = "PREF_KEY_ACCESS_TOKEN";
// 
//     @Inject
//     public PreferencesHelper(@ApplicationContext Context context) {
//         mPref = context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE);
//     }
// 
//     public void clear() {
//         mPref.edit().clear().apply();
//     }
// 
//     public void putAccessToken(String accessToken) {
//         mPref.edit().putString(PREF_KEY_ACCESS_TOKEN, accessToken).apply();
//     }
// 
//     @Nullable
//     public String getAccessToken() {
//         return mPref.getString(PREF_KEY_ACCESS_TOKEN, null);
//     }
// 
// }
// 
// Path: app/src/main/java/com/hitherejoe/androidtvboilerplate/data/remote/AndroidTvBoilerplateService.java
// public interface AndroidTvBoilerplateService {
// 
//     String ENDPOINT = "https://your.endpoint.com/";
// 
//     /********
//      * Helper class that sets up a new services
//      *******/
//     class Creator {
//         public static AndroidTvBoilerplateService newVineyardService() {
//             OkHttpClient client = new OkHttpClient();
//             client.interceptors().add(new Interceptor() {
//                 @Override
//                 public Response intercept(Chain chain) throws IOException {
//                     Response response = chain.proceed(chain.request());
//                     // Catch unauthorised error
//                     return response;
//                 }
//             });
// 
//             HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
//             interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
//             client.interceptors().add(interceptor);
// 
//             Retrofit retrofit = new Retrofit.Builder()
//                     .baseUrl(AndroidTvBoilerplateService.ENDPOINT)
//                     .client(client)
//                     .addConverterFactory(GsonConverterFactory.create())
//                     .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
//                     .build();
//             return retrofit.create(AndroidTvBoilerplateService.class);
//         }
//     }
// 
// }


import android.app.Application;
import android.content.Context;
import com.hitherejoe.androidtvboilerplate.data.DataManager;
import com.hitherejoe.androidtvboilerplate.data.local.PreferencesHelper;
import com.hitherejoe.androidtvboilerplate.data.remote.AndroidTvBoilerplateService;
import com.hitherejoe.androidtvboilerplate.injection.ApplicationContext;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import rx.subscriptions.CompositeSubscription;
import static org.mockito.Mockito.mock;
package com.hitherejoe.androidtvboilerplate.test.common.injection.module;






/**
 * Provides application-level dependencies for an app running on a testing environment
 * This allows injecting mocks if necessary.
 */
@Module
public class ApplicationTestModule {

    private final Application mApplication;

    public ApplicationTestModule(Application application) {
        mApplication = application;
    }

    @Provides
    Application provideApplication() {
        return mApplication;
    }

    @Provides
    @ApplicationContext
    Context provideContext() {
        return mApplication;
    }

    @Provides
    CompositeSubscription provideCompositeSubscription() {
        return new CompositeSubscription();
    }

    /************* MOCKS *************/

    @Provides
    @Singleton
    DataManager provideDataManager() {
        return mock(DataManager.class);
    }

    @Provides
    @Singleton
    PreferencesHelper providePreferencesHelper() {
// Path: app/src/main/java/com/hitherejoe/androidtvboilerplate/data/DataManager.java
// @Singleton
// public class DataManager {
// 
//     private final AndroidTvBoilerplateService mTvAndroidTvBoilerplateService;
//     private final PreferencesHelper mPreferencesHelper;
// 
//     @Inject
//     public DataManager(PreferencesHelper preferencesHelper,
//                        AndroidTvBoilerplateService androidTvBoilerplateService) {
//         mPreferencesHelper = preferencesHelper;
//         mTvAndroidTvBoilerplateService = androidTvBoilerplateService;
//     }
// 
//     public PreferencesHelper getPreferencesHelper() {
//         return mPreferencesHelper;
//     }
// 
//     public Single<List<Cat>> getCats(List<Cat> cats) {
//         // This just for example, usually here we'd make an API request and not pass a useless
//         // list of cats back that we passed in!
//         return Single.just(cats);
//     }
// 
// }
// 
// Path: app/src/main/java/com/hitherejoe/androidtvboilerplate/data/local/PreferencesHelper.java
// @Singleton
// public class PreferencesHelper {
// 
//     private final SharedPreferences mPref;
// 
//     public static final String PREF_FILE_NAME = "tv_boilerplate_pref_file";
//     private static final String PREF_KEY_ACCESS_TOKEN = "PREF_KEY_ACCESS_TOKEN";
// 
//     @Inject
//     public PreferencesHelper(@ApplicationContext Context context) {
//         mPref = context.getSharedPreferences(PREF_FILE_NAME, Context.MODE_PRIVATE);
//     }
// 
//     public void clear() {
//         mPref.edit().clear().apply();
//     }
// 
//     public void putAccessToken(String accessToken) {
//         mPref.edit().putString(PREF_KEY_ACCESS_TOKEN, accessToken).apply();
//     }
// 
//     @Nullable
//     public String getAccessToken() {
//         return mPref.getString(PREF_KEY_ACCESS_TOKEN, null);
//     }
// 
// }
// 
// Path: app/src/main/java/com/hitherejoe/androidtvboilerplate/data/remote/AndroidTvBoilerplateService.java
// public interface AndroidTvBoilerplateService {
// 
//     String ENDPOINT = "https://your.endpoint.com/";
// 
//     /********
//      * Helper class that sets up a new services
//      *******/
//     class Creator {
//         public static AndroidTvBoilerplateService newVineyardService() {
//             OkHttpClient client = new OkHttpClient();
//             client.interceptors().add(new Interceptor() {
//                 @Override
//                 public Response intercept(Chain chain) throws IOException {
//                     Response response = chain.proceed(chain.request());
//                     // Catch unauthorised error
//                     return response;
//                 }
//             });
// 
//             HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
//             interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
//             client.interceptors().add(interceptor);
// 
//             Retrofit retrofit = new Retrofit.Builder()
//                     .baseUrl(AndroidTvBoilerplateService.ENDPOINT)
//                     .client(client)
//                     .addConverterFactory(GsonConverterFactory.create())
//                     .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
//                     .build();
//             return retrofit.create(AndroidTvBoilerplateService.class);
//         }
//     }
// 
// }


// Path: app/src/commonTest/java/com/hitherejoe/androidtvboilerplate/test/common/injection/module/ApplicationTestModule.java
import android.app.Application;
import android.content.Context;
import com.hitherejoe.androidtvboilerplate.data.DataManager;
import com.hitherejoe.androidtvboilerplate.data.local.PreferencesHelper;
import com.hitherejoe.androidtvboilerplate.data.remote.AndroidTvBoilerplateService;
import com.hitherejoe.androidtvboilerplate.injection.ApplicationContext;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import rx.subscriptions.CompositeSubscription;
import static org.mockito.Mockito.mock;

package com.hitherejoe.androidtvboilerplate.test.common.injection.module;






/**
 * Provides application-level dependencies for an app running on a testing environment
 * This allows injecting mocks if necessary.
 */
@Module
public class ApplicationTestModule {

    private final Application mApplication;

    public ApplicationTestModule(Application application) {
        mApplication = application;
    }

    @Provides
    Application provideApplication() {
        return mApplication;
    }

    @Provides
    @ApplicationContext
    Context provideContext() {
        return mApplication;
    }

    @Provides
    CompositeSubscription provideCompositeSubscription() {
        return new CompositeSubscription();
    }

    /************* MOCKS *************/

    @Provides
    @Singleton
    DataManager provideDataManager() {
        return mock(DataManager.class);
    }

    @Provides
    @Singleton
    PreferencesHelper providePreferencesHelper() {
        return mock(PreferencesHelper.class);