Ejemplo n.º 1
0
        public static VerifyResult ValidMany(IDictionary <string, VerifiableMemberContext> keyValueCollections, List <CorrectValueRule> rules)
        {
            var len                 = rules.Count;
            var failures            = new List <VerifyFailure>();
            var nameOfExecutedRules = new List <string>();

            for (var i = 0; i < len; i++)
            {
                var valueRule = rules[i];

                if (keyValueCollections.TryGetValue(valueRule.MemberName, out var context))
                {
                    var ctx = VerifiableOpsContext.Create(context);

                    valueRule.Verify(ctx);

                    if (ctx.IncludeFailures)
                    {
                        failures.AddRange(ctx.VerifyValDictionary.ConvertToFailures());
                        nameOfExecutedRules.AddRange(ctx.NameOfExecutedRuleList);
                    }
                }
            }

            return(MakeMainResult(failures, nameOfExecutedRules));
        }
Ejemplo n.º 2
0
        public static VerifyResult Valid(VerifiableOpsContext context, List <CorrectValueRule> rules)
        {
            var len = rules.Count;

            for (var i = 0; i < len; i++)
            {
                rules[i].Verify(context);
            }

            return(MakeMainResult(context.VerifyValDictionary.ConvertToFailures(), context.NameOfExecutedRuleList));
        }
Ejemplo n.º 3
0
 public static VerifyResult ValidOne(VerifiableOpsContext context, List <CorrectValueRule> rules)
 {
     return(Valid(context, rules));
 }