@Test public void testisValidEmailShouldFail() { String[] str = {"@gmail.com", "test@yahoo.", "@yahoo.com"}; for (String s : str) { System.out.println(s); assertEquals(false, FormatCheck.isValidEmail(s)); } }
@Test public void testIsIPShouldFail() { String[] str = {"1.2.3.", ".2.3.", "1.2.3.q", ".2.3.1"}; for (String s : str) { System.out.println(s); assertEquals(false, FormatCheck.isValidIP(s)); } }
@Test public void testisValidEmailShouldPass() { String[] str = {"*****@*****.**", "*****@*****.**"}; for (String s : str) { System.out.println(s); assertEquals(true, FormatCheck.isValidEmail(s)); } }
@Test public void testIsIPShouldPass() { String[] str = {"1.2.3.4", "112.45.233.4"}; for (String s : str) { System.out.println(s); assertEquals(true, FormatCheck.isValidIP(s)); } }