Browse Source

working on tests

drop_old_mail
Stephan Richter 3 years ago
parent
commit
c8370a8aee
  1. 15
      src/test/java/de/srsoftware/widerhall/UtilTest.java

15
src/test/java/de/srsoftware/widerhall/UtilTest.java

@ -35,10 +35,21 @@ public class UtilTest extends TestCase { @@ -35,10 +35,21 @@ public class UtilTest extends TestCase {
}
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() {
// 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
}
}
Loading…
Cancel
Save