working on tests
This commit is contained in:
@@ -35,10 +35,21 @@ public class UtilTest extends TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIsEmail() {
|
public void testIsEmail() {
|
||||||
// TODO
|
assertFalse(Util.isEmail("Test"));
|
||||||
|
assertFalse(Util.isEmail("Test@"));
|
||||||
|
assertFalse(Util.isEmail("@Test"));
|
||||||
|
assertTrue(Util.isEmail("Test@Domain"));
|
||||||
|
assertFalse(Util.isEmail("Test@Domain@Test"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimplePassword() {
|
public void testSimplePassword() {
|
||||||
// TODO
|
assertTrue(Util.simplePassword("$@%€#")); // too short
|
||||||
|
assertTrue(Util.simplePassword("test123")); // no special chars
|
||||||
|
assertFalse(Util.simplePassword("test$23")); // contains special chars
|
||||||
|
assertTrue(Util.simplePassword("skgjafdsg")); // chars only
|
||||||
|
assertTrue(Util.simplePassword("986535465")); // digits only
|
||||||
|
assertFalse(Util.simplePassword("test9523")); // mixed digits and chars
|
||||||
|
assertFalse(Util.simplePassword("8986546054")); // digits only, but long enough
|
||||||
|
assertFalse(Util.simplePassword("salgksdjbw")); // chars only, but long enough
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user