Exemple #1
0
        private void TestForCondition(string condition, Action <SchemaChangedTrigger> action)
        {
            var trigger = new SchemaChangedTrigger {
                Condition = condition
            };

            action(trigger);

            if (string.IsNullOrWhiteSpace(condition))
            {
                A.CallTo(() => scriptEngine.Evaluate("event", A <object> ._, condition))
                .MustNotHaveHappened();
            }
            else
            {
                A.CallTo(() => scriptEngine.Evaluate("event", A <object> ._, condition))
                .MustHaveHappened();
            }
        }
Exemple #2
0
        private void TestForCondition(string condition, Action <RuleContext> action)
        {
            var trigger = new SchemaChangedTrigger
            {
                Condition = condition
            };

            action(Context(trigger));

            if (string.IsNullOrWhiteSpace(condition))
            {
                A.CallTo(() => scriptEngine.Evaluate(A <ScriptVars> ._, condition, default))
                .MustNotHaveHappened();
            }
            else
            {
                A.CallTo(() => scriptEngine.Evaluate(A <ScriptVars> ._, condition, default))
                .MustHaveHappened();
            }
        }
 public Task <IEnumerable <ValidationError> > Visit(SchemaChangedTrigger trigger)
 {
     return(Task.FromResult(Enumerable.Empty <ValidationError>()));
 }
 public RuleTriggerDto Visit(SchemaChangedTrigger trigger)
 {
     return(SimpleMapper.Map(trigger, new SchemaChangedRuleTriggerDto()));
 }