本文整理汇总了C#中RuleSet.VerifiedBy方法的典型用法代码示例。如果您正苦于以下问题:C# RuleSet.VerifiedBy方法的具体用法?C# RuleSet.VerifiedBy怎么用?C# RuleSet.VerifiedBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RuleSet
的用法示例。
在下文中一共展示了RuleSet.VerifiedBy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Verifies_SimpleTrueRules
public void Verifies_SimpleTrueRules()
{
var propertiesForObject = new Dictionary<object, object> { { "phrase_count", 2 }, { "length", 10 } };
var ruleSet = new RuleSet(new Rule[] { new GreaterThan("phrase_count", 1), new LessThan("length", 15) });
Assert.That(ruleSet.VerifiedBy(propertiesForObject), Is.True);
}
示例2: Equality_True
public void Equality_True()
{
var ruleSet = new RuleSet(new[] { new EqualTo("ciao", 1) });
var propertiesForObject = new Dictionary<object, object> { { "ciao", 1 }, { "length", 10 } };
Assert.That(ruleSet.VerifiedBy(propertiesForObject), Is.True);
}
示例3: Verifies_SimpleFalseRule
public void Verifies_SimpleFalseRule()
{
var propertiesForObject = new Dictionary<object, object> { { "phrase_count", 1 } };
var ruleSet = new RuleSet (new[]{new GreaterThan("phrase_count", 3)});
Assert.That(ruleSet.VerifiedBy(propertiesForObject), Is.False);
}
示例4: EmptyRuleSet_AlwaysTrue
public void EmptyRuleSet_AlwaysTrue()
{
var ruleSet = new RuleSet(new Rule[0]);
var propertiesForObject = new Dictionary<object, object> { { "phrase_count", 2 }, { "length", 10 } };
Assert.That(ruleSet.VerifiedBy(propertiesForObject));
}