// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintAuthenticationException.java
// public class FingerprintAuthenticationException extends Exception {
// 
//     private final String message;
// 
//     /**
//      * Creates exception that occurs during fingerprint authentication with message
//      *
//      * @param errString message of exception
//      */
//     public FingerprintAuthenticationException(CharSequence errString) {
//         message = errString.toString();
//     }
// 
//     @Override
//     public String getMessage() {
//         return message;
//     }
// }
// 
// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintAuthenticationResult.java
// public class FingerprintAuthenticationResult {
//     private final FingerprintResult result;
//     private final String message;
// 
//     /**
//      * Default constructor
//      *
//      * @param result  result of the fingerprint authentication
//      * @param message optional message to be displayed to the user
//      */
//     public FingerprintAuthenticationResult(FingerprintResult result, String message) {
//         this.result = result;
//         this.message = message;
//     }
// 
//     /**
//      * @return message that can be displayed to the user to help him guide through the
//      * authentication process
//      *
//      * Will only return a message if {@link FingerprintAuthenticationResult#result} is of type
//      * {@link FingerprintResult#HELP}. <b>Returns {@code null} otherwise!</b>
//      */
//     @Nullable
//     public String getMessage() {
//         return message;
//     }
// 
//     /**
//      * @return result of fingerprint authentication operation
//      */
//     public FingerprintResult getResult() {
//         return result;
//     }
// 
//     /**
//      * @return {@code true} if authentication was successful
//      */
//     public boolean isSuccess() {
//         return result == FingerprintResult.AUTHENTICATED;
//     }
// 
//     @Override
//     public String toString() {
//         return "FingerprintResult {"
//                 + "result=" + result.name() + ", "
//                 + "message=" + message +
//                 "}";
//     }
// }
// 
// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintResult.java
// public enum FingerprintResult {
//     FAILED, HELP, AUTHENTICATED
// }
// 
// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintUnavailableException.java
// public class FingerprintUnavailableException extends Exception {
// 
// 	public FingerprintUnavailableException(String s) {
// 		super(s);
// 	}
// }


import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintManager.AuthenticationResult;
import android.hardware.fingerprint.FingerprintManager.CryptoObject;
import android.os.CancellationSignal;
import android.os.Handler;
import com.mtramin.rxfingerprint.data.FingerprintAuthenticationException;
import com.mtramin.rxfingerprint.data.FingerprintAuthenticationResult;
import com.mtramin.rxfingerprint.data.FingerprintResult;
import com.mtramin.rxfingerprint.data.FingerprintUnavailableException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
package com.mtramin.rxfingerprint;






/**
 * Tests for the Fingerprint authentication observable
 */
@SuppressWarnings({"NewApi", "MissingPermission"})
@RunWith(MockitoJUnitRunner.class)
public class FingerprintAuthenticationTest {

    private static final String ERROR_MESSAGE = "Error message";
    private static final CharSequence MESSAGE_HELP = "Help message";

    @Mock FingerprintApiWrapper fingerprintApiWrapper;
    @Mock FingerprintManager fingerprintManager;
    @Mock CancellationSignal cancellationSignal;

// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintAuthenticationException.java
// public class FingerprintAuthenticationException extends Exception {
// 
//     private final String message;
// 
//     /**
//      * Creates exception that occurs during fingerprint authentication with message
//      *
//      * @param errString message of exception
//      */
//     public FingerprintAuthenticationException(CharSequence errString) {
//         message = errString.toString();
//     }
// 
//     @Override
//     public String getMessage() {
//         return message;
//     }
// }
// 
// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintAuthenticationResult.java
// public class FingerprintAuthenticationResult {
//     private final FingerprintResult result;
//     private final String message;
// 
//     /**
//      * Default constructor
//      *
//      * @param result  result of the fingerprint authentication
//      * @param message optional message to be displayed to the user
//      */
//     public FingerprintAuthenticationResult(FingerprintResult result, String message) {
//         this.result = result;
//         this.message = message;
//     }
// 
//     /**
//      * @return message that can be displayed to the user to help him guide through the
//      * authentication process
//      *
//      * Will only return a message if {@link FingerprintAuthenticationResult#result} is of type
//      * {@link FingerprintResult#HELP}. <b>Returns {@code null} otherwise!</b>
//      */
//     @Nullable
//     public String getMessage() {
//         return message;
//     }
// 
//     /**
//      * @return result of fingerprint authentication operation
//      */
//     public FingerprintResult getResult() {
//         return result;
//     }
// 
//     /**
//      * @return {@code true} if authentication was successful
//      */
//     public boolean isSuccess() {
//         return result == FingerprintResult.AUTHENTICATED;
//     }
// 
//     @Override
//     public String toString() {
//         return "FingerprintResult {"
//                 + "result=" + result.name() + ", "
//                 + "message=" + message +
//                 "}";
//     }
// }
// 
// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintResult.java
// public enum FingerprintResult {
//     FAILED, HELP, AUTHENTICATED
// }
// 
// Path: rxfingerprint/src/main/java/com/mtramin/rxfingerprint/data/FingerprintUnavailableException.java
// public class FingerprintUnavailableException extends Exception {
// 
// 	public FingerprintUnavailableException(String s) {
// 		super(s);
// 	}
// }


// Path: rxfingerprint/src/test/java/com/mtramin/rxfingerprint/FingerprintAuthenticationTest.java
import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintManager.AuthenticationResult;
import android.hardware.fingerprint.FingerprintManager.CryptoObject;
import android.os.CancellationSignal;
import android.os.Handler;
import com.mtramin.rxfingerprint.data.FingerprintAuthenticationException;
import com.mtramin.rxfingerprint.data.FingerprintAuthenticationResult;
import com.mtramin.rxfingerprint.data.FingerprintResult;
import com.mtramin.rxfingerprint.data.FingerprintUnavailableException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

package com.mtramin.rxfingerprint;






/**
 * Tests for the Fingerprint authentication observable
 */
@SuppressWarnings({"NewApi", "MissingPermission"})
@RunWith(MockitoJUnitRunner.class)
public class FingerprintAuthenticationTest {

    private static final String ERROR_MESSAGE = "Error message";
    private static final CharSequence MESSAGE_HELP = "Help message";

    @Mock FingerprintApiWrapper fingerprintApiWrapper;
    @Mock FingerprintManager fingerprintManager;
    @Mock CancellationSignal cancellationSignal;

    Observable<FingerprintAuthenticationResult> observable;