<commit_before>package com.mlykotom.valifi.fields;

import com.mlykotom.valifi.ValiFi;

import org.junit.BeforeClass;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;


public class ValiFieldEmailTest {
	public static final String EMAIL_ADDRESS_VALID = "<EMAIL>";
	public static final String EMAIL_ADDRESS_INVALID = "this_is_not_ok";
	public static final String EMAIL_ERROR_MSG = "email is not valid";


	@BeforeClass
	public static void installWithoutContext() {
		// WARNING: installing without context will crash when getting string, only for tests!
		ValiFi.install(null);
	}


	@Test
	public void checkConstructWithDefaultValidEmail() {
		ValiFieldEmail field = new ValiFieldEmail(EMAIL_ADDRESS_VALID, EMAIL_ERROR_MSG);
		assertThat(field.get(), is(EMAIL_ADDRESS_VALID));
		assertThat(field.getIsValid(), is(true));<commit_msg>Changes installing library in test<commit_after>package com.mlykotom.valifi.fields;

import com.mlykotom.valifi.ValiFi;

import org.junit.Before;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;


public class ValiFieldEmailTest {
	public static final String EMAIL_ADDRESS_VALID = "<EMAIL>";
	public static final String EMAIL_ADDRESS_INVALID = "this_is_not_ok";
	public static final String EMAIL_ERROR_MSG = "email is not valid";


	@Before
	public void installWithoutContext() {
		// WARNING: installing without context will crash when getting string, only for tests!
		ValiFi.install(null);
	}


	@Test
	public void checkConstructWithDefaultValidEmail() {
		ValiFieldEmail field = new ValiFieldEmail(EMAIL_ADDRESS_VALID, EMAIL_ERROR_MSG);
		assertThat(field.get(), is(EMAIL_ADDRESS_VALID));
		assertThat(field.getIsValid(), is(true));
{'fraction_non_alphanumeric': 0.09040178571428571, 'fraction_numerical': 0.0, 'mean_word_length': 6.059055118110236, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5147434', 'n_tokens_mistral': 581, 'n_tokens_neox': 561, 'n_words': 140}