예제 #1
0
        public void StringMatchesCaseInsensitiveRuleIsValid()
        {
            string target = "MATT";
            string comparisonValue = "matt";
            StringMatchesCaseInsensitive rule = new StringMatchesCaseInsensitive("StringMatchesCaseInsensitive", "The target string value does not match the comparison value.", target, comparisonValue);
            Result result = rule.Execute();

            Assert.IsTrue(result.IsValid);
            Assert.IsNotNullOrEmpty(result.Message);
            Assert.IsNotNull(result.RulePolicy);
            Assert.AreEqual(result.RulePolicy.Severity, Severity.Exception);
        }
 /// <summary>
 ///   Creates the rule.
 /// </summary>
 /// <param name="target"> </param>
 /// <returns> </returns>
 public override RulePolicy CreateRule(object target)
 {
     Rule = new StringMatchesCaseInsensitive(RuleName, FailMessage, (string)target, comparisonValue);
     return Rule;
 }