// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/emptystate/AssignEmptyState.java
// public class AssignEmptyState<T> implements FlowableTransformer<T, T> {
// 
//     private EmptyStateView view;
//     private Scheduler uiScheduler;
// 
//     public AssignEmptyState(EmptyStateView view, Scheduler uiScheduler) {
//         this.view = view;
//         this.uiScheduler = uiScheduler;
//     }
// 
//     @Override public Publisher<T> apply(Flowable<T> upstream) {
// 
//         HideAtStartShowAtError<T> delegate = new HideAtStartShowAtError<>(
//                 view.hideEmptyState(),
//                 view.showEmptyState(),
//                 error -> error instanceof ContentNotFoundError,
//                 uiScheduler
//         );
// 
//         return upstream.compose(delegate);
//     }
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/emptystate/EmptyStateView.java
// public interface EmptyStateView {
// 
//     Action showEmptyState();
// 
//     Action hideEmptyState();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/errors/ContentNotFoundError.java
// public class ContentNotFoundError extends RuntimeException {
// 
//     @Override public String getMessage() {
//         return "No content available";
//     }
// 
// }
// 
// Path: app/src/test/java/br/ufs/demos/rxmvp/playground/util/MockitoHelpers.java
// public static VerificationMode oneTimeOnly() {
//     return VerificationModeFactory.times(1);
// }


import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import br.ufs.demos.rxmvp.playground.core.behaviours.emptystate.AssignEmptyState;
import br.ufs.demos.rxmvp.playground.core.behaviours.emptystate.EmptyStateView;
import br.ufs.demos.rxmvp.playground.core.behaviours.errors.ContentNotFoundError;
import io.reactivex.Flowable;
import io.reactivex.Scheduler;
import io.reactivex.functions.Action;
import io.reactivex.schedulers.Schedulers;
import static br.ufs.demos.rxmvp.playground.util.MockitoHelpers.oneTimeOnly;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
package br.ufs.demos.rxmvp.playground.core;




/**
 * Created by bira on 6/30/17.
 */

public class AssignEmptyStateTests {

    Scheduler uiScheduler = Schedulers.trampoline();
    AssignEmptyState<Integer> assignEmptyness;

    @Mock Action showEmtpyState;
    @Mock Action hideEmtpyState;

    @Before public void beforeEachTest() {
        MockitoAnnotations.initMocks(this);

// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/emptystate/AssignEmptyState.java
// public class AssignEmptyState<T> implements FlowableTransformer<T, T> {
// 
//     private EmptyStateView view;
//     private Scheduler uiScheduler;
// 
//     public AssignEmptyState(EmptyStateView view, Scheduler uiScheduler) {
//         this.view = view;
//         this.uiScheduler = uiScheduler;
//     }
// 
//     @Override public Publisher<T> apply(Flowable<T> upstream) {
// 
//         HideAtStartShowAtError<T> delegate = new HideAtStartShowAtError<>(
//                 view.hideEmptyState(),
//                 view.showEmptyState(),
//                 error -> error instanceof ContentNotFoundError,
//                 uiScheduler
//         );
// 
//         return upstream.compose(delegate);
//     }
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/emptystate/EmptyStateView.java
// public interface EmptyStateView {
// 
//     Action showEmptyState();
// 
//     Action hideEmptyState();
// 
// }
// 
// Path: app/src/main/java/br/ufs/demos/rxmvp/playground/core/behaviours/errors/ContentNotFoundError.java
// public class ContentNotFoundError extends RuntimeException {
// 
//     @Override public String getMessage() {
//         return "No content available";
//     }
// 
// }
// 
// Path: app/src/test/java/br/ufs/demos/rxmvp/playground/util/MockitoHelpers.java
// public static VerificationMode oneTimeOnly() {
//     return VerificationModeFactory.times(1);
// }


// Path: app/src/test/java/br/ufs/demos/rxmvp/playground/core/AssignEmptyStateTests.java
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import br.ufs.demos.rxmvp.playground.core.behaviours.emptystate.AssignEmptyState;
import br.ufs.demos.rxmvp.playground.core.behaviours.emptystate.EmptyStateView;
import br.ufs.demos.rxmvp.playground.core.behaviours.errors.ContentNotFoundError;
import io.reactivex.Flowable;
import io.reactivex.Scheduler;
import io.reactivex.functions.Action;
import io.reactivex.schedulers.Schedulers;
import static br.ufs.demos.rxmvp.playground.util.MockitoHelpers.oneTimeOnly;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;

package br.ufs.demos.rxmvp.playground.core;




/**
 * Created by bira on 6/30/17.
 */

public class AssignEmptyStateTests {

    Scheduler uiScheduler = Schedulers.trampoline();
    AssignEmptyState<Integer> assignEmptyness;

    @Mock Action showEmtpyState;
    @Mock Action hideEmtpyState;

    @Before public void beforeEachTest() {
        MockitoAnnotations.initMocks(this);

        EmptyStateView view = new EmptyStateView() {