Beispiel #1
0
        public void RubberStamp_Conditions_RegexCondition_Regex_InValid_Number_Test()
        {
            var condition = new RegexCondition <TestClass, string>(p => p.Email, @"^[0-9]");

            Assert.IsFalse(condition.IsValid(new TestClass {
                Email = "test"
            }));
        }
Beispiel #2
0
        public void RubberStamp_Conditions_RegexCondition_Regex_Validate_Number_Test()
        {
            var condition = new RegexCondition <TestClass, string>(p => p.Index.ToString(), @"^[0-9]");

            Assert.IsTrue(condition.IsValid(new TestClass {
                Index = 1234567890
            }));
        }
Beispiel #3
0
        public void RubberStamp_Conditions_RegexCondition_Regex_Validate_Characters_Test()
        {
            var condition = new RegexCondition <TestClass, string>(p => p.Email, @"^[a-zA-Z]");

            Assert.IsTrue(condition.IsValid(new TestClass {
                Email = "abcABC"
            }));
        }