예제 #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);
        }
예제 #2
0
 /// <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;
 }