public void MaxValueDateTimeIsValid() { DateTime target = DateTime.Now; DateTime comparisonValue = DateTime.Now.AddMinutes(1); MaxValue<DateTime> rule = new MaxValue<DateTime>("MaxValueRule", "The target is not valid. Must be equal or less than 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); }
public void MaxValueIntIsValid() { int target = 10; int comparisonValue = 10; MaxValue <int> rule = new MaxValue <int>("MaxValueRule", "The target is not valid. Must be equal or less than 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); }
public void MaxValueDateTimeIsValid() { DateTime target = DateTime.Now; DateTime comparisonValue = DateTime.Now.AddMinutes(1); MaxValue <DateTime> rule = new MaxValue <DateTime>("MaxValueRule", "The target is not valid. Must be equal or less than 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); }
public void MaxValueIntIsValid() { int target = 10; int comparisonValue = 10; MaxValue<int> rule = new MaxValue<int>("MaxValueRule", "The target is not valid. Must be equal or less than 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); }