@@ -0,0 +1,2394 @@
+package io.github.plastix.forage.data.location;%0A%0Aimport android.location.Location;%0A%0Aimport com.google.android.gms.location.LocationRequest;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0Aimport io.github.plastix.forage.ForageRoboelectricUnitTestRunner;%0Aimport rx.Completable;%0Aimport rx.Observable;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(ForageRoboelectricUnitTestRunner.class)%0Apublic class LocationInteractorTest %7B%0A%0A    private LocationObservableFactory locationObservableFactory;%0A    private LocationCompletableFactory locationCompletableFactory;%0A    private LocationInteractor locationInteractor;%0A%0A    @Before%0A    public void beforeEachTest() %7B%0A        locationObservableFactory = mock(LocationObservableFactory.class);%0A        locationCompletableFactory = mock(LocationCompletableFactory.class);%0A%0A        locationInteractor = new LocationInteractor(locationObservableFactory, locationCompletableFactory);%0A    %7D%0A%0A    @Test%0A    public void isLocationAvailable_returnsLocationCompletable() %7B%0A        Completable result = Completable.complete();%0A        when(locationCompletableFactory.buldLocationCompletable()).thenReturn(result);%0A%0A        Completable out = locationInteractor.isLocationAvailable();%0A%0A        verify(locationCompletableFactory, times(1)).buldLocationCompletable();%0A        assertThat(out).isEqualTo(result);%0A    %7D%0A%0A    @Test%0A    public void getUpdatedLocation_returnsLocationObservable() %7B%0A        Observable%3CLocation%3E result = Observable.empty();%0A        when(locationObservableFactory.buildObservable(any(LocationRequest.class))).thenReturn(result);%0A%0A        locationInteractor.getUpdatedLocation();%0A%0A        verify(locationObservableFactory, times(1)).buildObservable(any(LocationRequest.class));%0A    %7D%0A%0A    @Test%0A    public void getLocationObservable_returnsLocationObservable() %7B%0A        Observable%3CLocation%3E result = Observable.empty();%0A        when(locationObservableFactory.buildObservable(any(LocationRequest.class))).thenReturn(result);%0A%0A        locationInteractor.getLocationObservable(1000);%0A%0A        verify(locationObservableFactory, times(1)).buildObservable(any(LocationRequest.class));%0A    %7D%0A%7D%0A

Add LocationInteractor unit tests