public void Then_VerbalExpressionsUrl_DoesNotMatchEmail()
        {
            verbEx = VerbalExpressions.DefaultExpression;
            verbEx.StartOfLine().Then(CommonRegex.Url);

            Assert.IsFalse(verbEx.IsMatch("*****@*****.**"), "Should not match email address");
        }
        public void Then_VerbalExpressionsEmail_DoesNotMatchUrl()
        {
            verbEx = VerbalExpressions.DefaultExpression;
            verbEx.StartOfLine().Then(CommonRegex.Email);

            var isMatch = verbEx.IsMatch("http://www.google.com");

            Assert.IsFalse(isMatch, "Should not match url address");
        }
        public void Then_VerbalExpressionsEmail_DoesMatchEmail()
        {
            verbEx = VerbalExpressions.DefaultExpression;
            verbEx.StartOfLine().Then(CommonRegex.Email);

            var isMatch = verbEx.IsMatch("*****@*****.**");

            Assert.IsTrue(isMatch, "Should match email address");
        }
        public void Then_VerbalExpressionsUrl_DoesMatchUrl()
        {
            verbEx = VerbalExpressions.DefaultExpression;
            verbEx.StartOfLine()
            .Then(CommonRegex.Url);

            Assert.IsTrue(verbEx.IsMatch("http://www.google.com"), "Should match url address");
            Assert.IsTrue(verbEx.IsMatch("https://www.google.com"), "Should match url address");
            Assert.IsTrue(verbEx.IsMatch("http://google.com"), "Should match url address");
        }
        public void StartOfLine_ThenHttpMaybeWww_DoesNotMatchWwwInStart()
        {
            verbEx = VerbalExpressions.DefaultExpression;
            verbEx.StartOfLine()
            .Then("http")
            .Maybe("www");

            var isMatch = verbEx.IsMatch("www");

            Assert.IsFalse(isMatch, "Should not match www in start");
        }
        public void StartOfLine_ThenHttpMaybeWww_DoesMatchHttpInStart()
        {
            verbEx = VerbalExpressions.DefaultExpression;
            verbEx.StartOfLine()
            .Then("http")
            .Maybe("www");

            var isMatch = Regex.IsMatch("http", verbEx.ToString());

            Assert.IsTrue(isMatch, "Should match http in start");
        }
        public void Anything_StartOfLineAnythingEndOfline_DoesMatchAnyThing()
        {
            verbEx = VerbalExpressions.DefaultExpression;
            verbEx
            .StartOfLine()
            .Anything()
            .EndOfLine();


            var isMatch = verbEx.IsMatch("'!@#$%¨&*()__+{}'");

            Assert.IsTrue(isMatch, "Ooops, should match anything");
        }
 public void StartOfLine_CreatesCorrectRegex()
 {
     verbEx.StartOfLine();
     Assert.AreEqual("^", verbEx.ToString(), "missing start of line regex");
 }
 public void StartOfLine_CreatesCorrectRegex()
 {
     verbEx = VerbalExpressions.DefaultExpression;
     verbEx.StartOfLine();
     Assert.AreEqual("^", verbEx.ToString(), "missing start of line regex");
 }
 public VerbalExpression StartOfLine()
 {
     _verbalExpression.StartOfLine();
     return(this);
 }