/// <summary> /// Compares the given clr value value to the given query scalar value, and throws a DataComparisonException if they dont match /// </summary> /// <param name="expected">expected CLR value</param> /// <param name="actual">actual query primitive value to compare</param> /// <param name="assert">The assertion handler to use</param> public void Compare(object expected, QueryScalarValue actual, AssertionHandler assert) { if (actual.IsDynamicPropertyValue()) { expected = this.converter.SerializePrimitive(expected); actual = new QueryClrPrimitiveType(typeof(string), actual.Type.EvaluationStrategy).CreateValue(this.converter.SerializePrimitive(actual.Value)); } this.UnderlyingComparer.Compare(expected, actual, assert); }
/// <summary> /// Compares the given clr value to the given query scalar value, and throws a DataComparisonException if they dont match /// </summary> /// <param name="expected">expected CLR value</param> /// <param name="actual">actual query primitive value to compare</param> /// <param name="assert">The assertion handler to use</param> public override void Compare(object expected, QueryScalarValue actual, AssertionHandler assert) { ExceptionUtilities.CheckArgumentNotNull(actual, "actual"); if (actual.IsDynamicPropertyValue() && !(actual.Type is QueryClrSpatialType)) { this.CompareDynamicValues(actual.Type, expected, actual.Value, assert); } else { base.Compare(expected, actual, assert); } }
/// <summary> /// Returns whether or not to expect lazy evaluation of less than for a null first value. /// </summary> /// <param name="firstValue">The first value.</param> /// <returns>True if lazy null evaluation should be expected</returns> internal static bool ExpectLazyNullEvaluatiorForLessThan(QueryScalarValue firstValue) { var clrType = ((IQueryClrType)firstValue.Type).ClrType; bool lazyNullEvaluation = firstValue.IsNull && IsSpecialCaseTypeForLessThan(clrType) && !firstValue.IsDynamicPropertyValue(); return lazyNullEvaluation; }
/// <summary> /// Returns whether or not to expect lazy evaluation of less than for a null first value. /// </summary> /// <param name="firstValue">The first value.</param> /// <returns>True if lazy null evaluation should be expected</returns> internal static bool ExpectLazyNullEvaluatiorForLessThan(QueryScalarValue firstValue) { var clrType = ((IQueryClrType)firstValue.Type).ClrType; bool lazyNullEvaluation = firstValue.IsNull && IsSpecialCaseTypeForLessThan(clrType) && !firstValue.IsDynamicPropertyValue(); return(lazyNullEvaluation); }