package com.basgeekball.awesomevalidation.utility;

import junit.framework.TestCase;

import java.util.regex.Pattern;

public class RegexTemplateTest extends TestCase {

    @Override
    protected void setUp() throws Exception {
        super.setUp();
    }

    public void testConstantNotEmpty() {
        Pattern pattern = Pattern.compile(RegexTemplate.NOT_EMPTY);
        assertTrue(pattern.matcher("a").matches());
        assertTrue(pattern.matcher("1").matches());
        assertTrue(pattern.matcher(".").matches());
        assertTrue(pattern.matcher("$").matches());
        assertTrue(pattern.matcher("!@#$%^&*()").matches());
        assertTrue(pattern.matcher("a1").matches());
        assertTrue(pattern.matcher("1q2w3e").matches());
        assertTrue(pattern.matcher(" x").matches());
        assertTrue(pattern.matcher("x ").matches());
        assertTrue(pattern.matcher(" x ").matches());
        assertFalse(pattern.matcher("").matches());
        assertFalse(pattern.matcher(" ").matches());
        assertFalse(pattern.matcher("  ").matches());
    }

    public void testConstantTelephone() {
        Pattern pattern = Pattern.compile(RegexTemplate.TELEPHONE);
        assertTrue(pattern.matcher("1234567890").matches());
        assertTrue(pattern.matcher("+49-030-00000001").matches());
        assertFalse(pattern.matcher("a123456789").matches());
    }

}

@@ -1323,41 +1323,607 @@
 sert
-False(pattern.matcher(%22a123456789
+True(pattern.matcher(%22+49-(030)-00000001%22).matches());%0A        assertTrue(pattern.matcher(%22+490123456789%22).matches());%0A        assertTrue(pattern.matcher(%22(0)12345678%22).matches());%0A        assertTrue(pattern.matcher(%22030-00000001%22).matches());%0A        assertTrue(pattern.matcher(%22123456789-001%22).matches());%0A        assertFalse(pattern.matcher(%2249+007%22).matches());%0A        assertFalse(pattern.matcher(%22a123456789%22).matches());%0A        assertFalse(pattern.matcher(%22123456789b%22).matches());%0A        assertFalse(pattern.matcher(%22++49-00000001%22).matches());%0A        assertFalse(pattern.matcher(%22123*456
 %22).m

Add more assertions to RegexTemplateTest