Exemple #1
0
        public void IsNullRuleIsValid()
        {
            object target = null;
            IsNull rule = new IsNull("IsNotNull", "The target is null. Cannot be null.", target);
            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 IsNull(RuleName, FailMessage, target);
     return Rule;
 }