コード例 #1
0
        public static StringMandateContext IsNull(this StringMandateContext context)
        {
            Mandate.That(context, context.Value != null, () => new ArgumentException(context.ParamName));


            return(new StringMandateContext(context));
        }
コード例 #2
0
        public static StringMandateContext IsEmpty(this StringMandateContext context)
        {
            Mandate.That(context, context.Value == string.Empty,
                         () => new ArgumentException(context.ParamName));

            return(new StringMandateContext(context));
        }
コード例 #3
0
        public static StringMandateContext IsLengthGreaterThan(this StringMandateContext context, int comparisonValue)
        {
            Mandate.That(context, context.Value.Length > comparisonValue,
                         () => new ArgumentOutOfRangeException(context.ParamName, context.Value, string.Empty));

            return(new StringMandateContext(context));
        }
コード例 #4
0
        public static StringMandateContext IsNotNullOrEmpty(this StringMandateContext context)
        {
            Mandate.That(context, string.IsNullOrEmpty(context.Value),
                         () => new ArgumentException(context.ParamName));

            return(new StringMandateContext(context));
        }