You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
917 B
24 lines
917 B
package de.superx.sec; |
|
|
|
import org.junit.Assert; |
|
import org.junit.Test; |
|
|
|
public class DefaultCheckTest { |
|
|
|
private static String[] SAMPLES_FOR_VALID_FORMAT = {"", "135€", "Marçel", "Søren", "Rathausstraße", |
|
"info@mailinator.com", "line 1\r\nline 2", "test^csv^upload^functionality"}; |
|
private static String[] SAMPLES_FOR_INVALID_FORMAT = {";", "1,2,3,4,5", "sp_get_keylist_str($$bla1$$,$$bla2$$)::INT"}; |
|
|
|
@SuppressWarnings("static-method") |
|
@Test |
|
public void testConfirmFormat() { |
|
DefaultCheck testee = new DefaultCheck(); |
|
for (String sample : SAMPLES_FOR_VALID_FORMAT) { |
|
Assert.assertTrue("expected '" + sample + "' to be valid pattern", testee.check(sample)); |
|
} |
|
for (String sample : SAMPLES_FOR_INVALID_FORMAT) { |
|
Assert.assertFalse("expected '" + sample + "' to be invalid pattern", testee.check(sample)); |
|
} |
|
} |
|
|
|
}
|
|
|