Exemple #1
0
 public override string GetPointQuery()
 {
     return(String.Format(
                CultureInfo.InvariantCulture,
                "({0} {1} {2})",
                fieldName,
                pointCmp != Comparison.Comparison_Unknown ? ComparisonUtil.ComparisonToString(pointCmp) : rand.Next(2) == 0 ? "=" : "!=",
                singleValue.HasValue ? (singleValue.Value ? "true" : "false") : (rand.Next(2) > 0 ? "true" : "false")));
 }
Exemple #2
0
        public override string GetRangeQuery()
        {
            if (singleValue.HasValue)
            {
                return(null);
            }

            int delta = (maxValue.Value - minValue.Value) / 4;

            return(GetRangeQuery(
                       lowerCmp != Comparison.Comparison_Unknown ? ComparisonUtil.ComparisonToString(lowerCmp) : rand.Next(2) == 0 ? ">" : ">=",
                       rand.Next(minValue.Value, minValue.Value + delta / 4 + 1),
                       upperCmp != Comparison.Comparison_Unknown ? ComparisonUtil.ComparisonToString(upperCmp) : rand.Next(2) == 0 ? "<" : "<=",
                       rand.Next(maxValue.Value - delta / 4, maxValue.Value + 1)));
        }
Exemple #3
0
        public override string GetRangeQuery()
        {
            if (singleValue.HasValue)
            {
                return(null);
            }

            double delta = (maxValue.Value - minValue.Value) / 4;

            return(GetRangeQuery(
                       lowerCmp != Comparison.Comparison_Unknown ? ComparisonUtil.ComparisonToString(lowerCmp) : rand.Next(2) == 0 ? ">" : ">=",
                       rand.NextDouble() * (delta) + minValue,
                       upperCmp != Comparison.Comparison_Unknown ? ComparisonUtil.ComparisonToString(upperCmp) : rand.Next(2) == 0 ? "<" : "<=",
                       maxValue - rand.NextDouble() * (delta)));
        }
Exemple #4
0
 protected string GetRangeQuery(Comparison lower, T min, Comparison upper, T max)
 {
     return(GetRangeQuery(ComparisonUtil.ComparisonToString(lower), min, ComparisonUtil.ComparisonToString(upper), max));
 }
Exemple #5
0
 protected virtual string GetPointQuery(Comparison point, T value)
 {
     return(GetPointQuery(ComparisonUtil.ComparisonToString(point), value));
 }
Exemple #6
0
 protected virtual string GetPointQuery(T value)
 {
     return(GetPointQuery(
                pointCmp != Comparison.Comparison_Unknown ? ComparisonUtil.ComparisonToString(pointCmp) : rand.Next(10) > 0 ? "=" : "!=",
                value));
 }