Exemple #1
0
        public void Match_FailsWhenPatternIsNotMatched()
        {
            RegexHttpRouteConstraint constraint = new RegexHttpRouteConstraint(@"^\d{3}$");
            bool match = TestValue(constraint, "1234");

            Assert.False(match);
        }
Exemple #2
0
        public void Match_SucceedsWhenPatternIsMatched()
        {
            RegexHttpRouteConstraint constraint = new RegexHttpRouteConstraint(@"^\d{3}-\d{3}-\d{4}$");
            bool match = TestValue(constraint, "406-555-0123");

            Assert.True(match);
        }
 public void Match_FailsWhenPatternIsNotMatched()
 {
     RegexHttpRouteConstraint constraint = new RegexHttpRouteConstraint(@"^\d{3}$");
     bool match = TestValue(constraint, "1234");
     Assert.False(match);
 }
 public void Match_SucceedsWhenPatternIsMatched()
 {
     RegexHttpRouteConstraint constraint = new RegexHttpRouteConstraint(@"^\d{3}-\d{3}-\d{4}$");
     bool match = TestValue(constraint, "406-555-0123");
     Assert.True(match);
 }