package data;

import static org.junit.Assert.assertSame;

import java.util.Arrays;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import org.omg.CORBA.StringHolder;

@RunWith(Parameterized.class)
public class MemberValidatorEmailTest {
	
	String email;
	boolean expected;
	StringHolder messageHolder = new StringHolder();
	
	public MemberValidatorEmailTest(boolean expected, String email) {
		this.email = email;
		this.expected = expected;
	}
	
	@Parameters
	public static List<Object[]> getParams() {
		return Arrays.asList(new Object[][]{
				// Null or Empty are valid for us, might not be for you.
				{true, null },
				{true, "" },
				// From short to long, roughly
				{true, "a@b.co"},
				{false, "a at b.co" },
				{true, "a.b.c@d.e.f.com"},
				{true, "ketchup@mcdonalds.infomaterial"},
				{false, "a-b@c.com"},			
		});
	}	
	
	@Test
	public void test() {
		assertSame(expected, MemberHome.validateEmail(email, messageHolder));
	}

}

Bring in the email validation test too.
Bring in the email validation test too.
