Exemplo n.º 1
0
 public void TestPredicateCondition()
 {
     string newValue = "bcd";
     PropertyRule rule = PropertyRule.Create<TestModel, string>(e => e.StrProperty);
     Func<TestModel, bool> predicate = e => e.StrProperty != null;
     rule.AddCondition(new PredicateCondition(predicate.CoerceToNonGeneric()));
     rule.Assign(e => newValue);
     TestModel model = new TestModel();
     ConditionContext context = new ConditionContext(model);
     rule.Set(context);
     Assert.AreNotEqual(model.StrProperty, newValue);
 }
Exemplo n.º 2
0
 public void TestMethod1()
 {
     string newValue = "bcd";
     PropertyRule rule = PropertyRule.Create<TestModel, string>(e => e.StrProperty);
     rule.Assign(e => newValue);
     TestModel model = new TestModel();
     ConditionContext context = new ConditionContext(model);
     rule.Set(context);
     Assert.AreEqual(model.StrProperty, newValue);
     //
     // TODO: Add test logic here
     //
 }