diff --git a/src/test/java/de/srsoftware/widerhall/UtilTest.java b/src/test/java/de/srsoftware/widerhall/UtilTest.java index 17ece1c..faa4ace 100644 --- a/src/test/java/de/srsoftware/widerhall/UtilTest.java +++ b/src/test/java/de/srsoftware/widerhall/UtilTest.java @@ -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 } } \ No newline at end of file