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")));
 }
        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)));
        }
        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)));
        }
        public override string GetRangeQuery()
        {
            if (this.singleValue.HasValue)
            {
                return(null);
            }

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

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