Пример #1
0
        public void AreEqualIsTrue()
        {
            object target = 1;
            object comparisonObject = 1;
            AreEqual rule = new AreEqual("AreEqual", "AreEqualIsTrue", 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);
        }
Пример #2
0
 /// <summary>
 ///   Creates the rule.
 /// </summary>
 /// <param name="target"> </param>
 /// <returns> </returns>
 public override RulePolicy CreateRule(object target)
 {
     Rule = new AreEqual(RuleName, FailMessage, target, comparisonTarget);
     return Rule;
 }