// Path: valifi/src/test/java/com/mlykotom/valifi/ValiFiTest.java
// public class ValiFiTest {
// 	public static final String FIELD_ERROR_MSG = "field is not valid";
// 	private ValiFieldBase<String> mField;
// 
// 	/**
// 	 * WARNING: installing without context will crash when getting string, only for tests!
// 	 */
// 	public static void installWithoutContext() {
// 		ValiFi.install();
// 	}
// 
// 	@Before
// 	public void prepareField() {
// 		installWithoutContext();
// 		mField = new ValiFieldText();
// 	}
// 
// 	@Test
// 	public void checkLibraryInstalled() {
// 		assertThat(ValiFi.getInstance(), notNullValue());
// 	}
// 
// 	@Test
// 	public void checkLibraryInstalledByAddingValidator() {
// 		mField.addCustomValidator(R.string.validation_error_email, new ValiFieldBase.PropertyValidator<String>() {
// 			@Override
// 			public boolean isValid(@Nullable String value) {
// 				// it doesn't matter if it's valid, checking installation
// 				return false;
// 			}
// 		});
// 	}
// 
// 	@Test
// 	public void checkErrorResourcesMatchLength() {
// 		int errorResArrCount = ValiFi.getInstance().mParameters.mErrorResources.length;
// 		assertThat(errorResArrCount, is(ValiFi.Builder.ERROR_RES_COUNT));
// 	}
// 
// 	@Test
// 	public void checkPatternsMatchLength() {
// 		int patternsArrCount = ValiFi.getInstance().mParameters.mValidators.length;
// 		assertThat(patternsArrCount, is(ValiFi.Builder.PATTERN_COUNT));
// 	}
// 
// 	@Test
// 	public void checkErrorResourcesMathStrings() {
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_NOT_EMPTY), is(R.string.validation_error_empty));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_LENGTH_MIN), is(R.string.validation_error_min_length));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_LENGTH_MAX), is(R.string.validation_error_max_length));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_LENGTH_RANGE), is(R.string.validation_error_range_length));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_LENGTH_EXACT), is(R.string.validation_error_exact_length));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_EMAIL), is(R.string.validation_error_email));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_PHONE), is(R.string.validation_error_phone));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_USERNAME), is(R.string.validation_error_username));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_PASSWORD), is(R.string.validation_error_password));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_YEARS_OLDER_THAN), is(R.string.validation_error_older_than_years));
// 	}
// }
// 
// Path: valifi/src/main/java/com/mlykotom/valifi/exceptions/ValiFiValidatorException.java
// public class ValiFiValidatorException extends ValiFiException {
// 	public ValiFiValidatorException() {}
// 
// 	public ValiFiValidatorException(String message) {
// 		super(message);
// 	}
// }


import com.mlykotom.valifi.ValiFiTest;
import com.mlykotom.valifi.exceptions.ValiFiValidatorException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.core.IsNull.nullValue;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
package com.mlykotom.valifi.fields;




public class ValiFieldTextTest {
	private static final String VALIDATOR_EMPTY_MESSAGE = "field can't be empty";
	private ValiFieldText mField;

	@Before
	public void prepareField() {
		ValiFiTest.installWithoutContext();
		mField = new ValiFieldText();
	}

	@After
	public void destroyField() {
		mField.destroy();
		// check if field is still valid
		assertThat(mField.isValid(), is(false));
		// check bound values
//		assertThat(mField.mBoundFields, is(nullValue()));	// TODO we'd like to handle that
		// check if has form
		assertThat(mField.getBoundForm(), is(nullValue()));

		// TODO check if we can do something with the field (we should not)
	}

// Path: valifi/src/test/java/com/mlykotom/valifi/ValiFiTest.java
// public class ValiFiTest {
// 	public static final String FIELD_ERROR_MSG = "field is not valid";
// 	private ValiFieldBase<String> mField;
// 
// 	/**
// 	 * WARNING: installing without context will crash when getting string, only for tests!
// 	 */
// 	public static void installWithoutContext() {
// 		ValiFi.install();
// 	}
// 
// 	@Before
// 	public void prepareField() {
// 		installWithoutContext();
// 		mField = new ValiFieldText();
// 	}
// 
// 	@Test
// 	public void checkLibraryInstalled() {
// 		assertThat(ValiFi.getInstance(), notNullValue());
// 	}
// 
// 	@Test
// 	public void checkLibraryInstalledByAddingValidator() {
// 		mField.addCustomValidator(R.string.validation_error_email, new ValiFieldBase.PropertyValidator<String>() {
// 			@Override
// 			public boolean isValid(@Nullable String value) {
// 				// it doesn't matter if it's valid, checking installation
// 				return false;
// 			}
// 		});
// 	}
// 
// 	@Test
// 	public void checkErrorResourcesMatchLength() {
// 		int errorResArrCount = ValiFi.getInstance().mParameters.mErrorResources.length;
// 		assertThat(errorResArrCount, is(ValiFi.Builder.ERROR_RES_COUNT));
// 	}
// 
// 	@Test
// 	public void checkPatternsMatchLength() {
// 		int patternsArrCount = ValiFi.getInstance().mParameters.mValidators.length;
// 		assertThat(patternsArrCount, is(ValiFi.Builder.PATTERN_COUNT));
// 	}
// 
// 	@Test
// 	public void checkErrorResourcesMathStrings() {
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_NOT_EMPTY), is(R.string.validation_error_empty));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_LENGTH_MIN), is(R.string.validation_error_min_length));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_LENGTH_MAX), is(R.string.validation_error_max_length));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_LENGTH_RANGE), is(R.string.validation_error_range_length));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_LENGTH_EXACT), is(R.string.validation_error_exact_length));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_EMAIL), is(R.string.validation_error_email));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_PHONE), is(R.string.validation_error_phone));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_USERNAME), is(R.string.validation_error_username));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_PASSWORD), is(R.string.validation_error_password));
// 		assertThat(mField.getErrorRes(ValiFi.Builder.ERROR_RES_YEARS_OLDER_THAN), is(R.string.validation_error_older_than_years));
// 	}
// }
// 
// Path: valifi/src/main/java/com/mlykotom/valifi/exceptions/ValiFiValidatorException.java
// public class ValiFiValidatorException extends ValiFiException {
// 	public ValiFiValidatorException() {}
// 
// 	public ValiFiValidatorException(String message) {
// 		super(message);
// 	}
// }


// Path: valifi/src/test/java/com/mlykotom/valifi/fields/ValiFieldTextTest.java
import com.mlykotom.valifi.ValiFiTest;
import com.mlykotom.valifi.exceptions.ValiFiValidatorException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.core.IsNull.nullValue;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;

package com.mlykotom.valifi.fields;




public class ValiFieldTextTest {
	private static final String VALIDATOR_EMPTY_MESSAGE = "field can't be empty";
	private ValiFieldText mField;

	@Before
	public void prepareField() {
		ValiFiTest.installWithoutContext();
		mField = new ValiFieldText();
	}

	@After
	public void destroyField() {
		mField.destroy();
		// check if field is still valid
		assertThat(mField.isValid(), is(false));
		// check bound values
//		assertThat(mField.mBoundFields, is(nullValue()));	// TODO we'd like to handle that
		// check if has form
		assertThat(mField.getBoundForm(), is(nullValue()));

		// TODO check if we can do something with the field (we should not)
	}

	@Test(expected = ValiFiValidatorException.class)