Ejemplo n.º 1
0
        public void SetUp()
        {
            this.argumentsOfCorrectType = new ArgumentsOfCorrectType();
            this.validationTestSchema   = new TestSchema();

            this.validationContext = new ValidationContext();
        }
        public static void badValue(
            this ArgumentsOfCorrectType rule,
            ValidationTestConfig config,
            string argName,
            string typeName,
            string value,
            int line,
            int column,
            string errors = null)
        {
            errors ??= $"Expected type '{typeName}', found {value}.";

            config.Error(
                ArgumentsOfCorrectTypeError.BadValueMessage(argName, errors),
                line,
                column);
        }
        public static void badValue(
            this ArgumentsOfCorrectType rule,
            ValidationTestConfig config,
            string argName,
            string typeName,
            string value,
            int line,
            int column,
            IEnumerable <string> errors = null)
        {
            errors ??= new[] { $"Expected type \"{typeName}\", found {value}." };

            config.Error(
                ArgumentsOfCorrectTypeError.BadValueMessage(argName, value, errors),
                line,
                column);
        }
Ejemplo n.º 4
0
        public static void badValue(
            this ArgumentsOfCorrectType rule,
            ValidationTestConfig _,
            string argName,
            string typeName,
            string value,
            int?line   = null,
            int?column = null,
            IEnumerable <string> errors = null)
        {
            if (errors == null)
            {
                errors = new [] { $"Expected type \"{typeName}\", found {value}." };
            }

            _.Error(
                rule.BadValueMessage(argName, null, value, errors),
                line,
                column);
        }