Exemplo n.º 1
0
        public void AreNotEqualIsNotTrueWithNullComparisonObject()
        {
            object target = 1;
            object comparisonObject = null;
            AreNotEqual rule = new AreNotEqual("AreEqual", "AreNotEqualIsTrue", target, comparisonObject);
            Result result = rule.Execute();

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