Пример #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();
            }
        }
Пример #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();
            }
        }
Пример #3
0
 public Task <IEnumerable <ValidationError> > Visit(SchemaChangedTrigger trigger)
 {
     return(Task.FromResult(Enumerable.Empty <ValidationError>()));
 }
Пример #4
0
 public RuleTriggerDto Visit(SchemaChangedTrigger trigger)
 {
     return(SimpleMapper.Map(trigger, new SchemaChangedRuleTriggerDto()));
 }