private void TestFromBoolean(_Boolean x, Single?expectedValue) { _Single expr = (_Single)x; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(x, typeof(bool?), typeof(Single?)); expr.VerifyEval(expectedValue); }
private void TestFromSingle(Single?x, Int32?expectedValue) { _Single column1 = x; _Int32 expr = (_Int32)column1; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(column1, typeof(Single?), typeof(Int32?)); expr.VerifyEval(expectedValue); }
private void TestFromSingle(Single?x, Double?expectedValue) { _Single column1 = x; _Double expr = (_Double)column1; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(column1, typeof(Single?), typeof(Double?)); expr.VerifyEval(expectedValue); }
private void TestNegate(Single?x, Single?expectedValue) { _Single column = x; var expr = -column; var dbExpr = (DbUnaryExpression)expr.DbExpression; dbExpr.Verify(DbUnaryExpressionKind.Negate, column); expr.VerifyEval(expectedValue); }
private void TestCastToString(Single?x, String expectedValue) { _Single column1 = x; _String expr = (_String)column1; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(column1, typeof(Single?), typeof(String)); expr.VerifyEval(expectedValue); }
private void TestFromString(String x, Single?expectedValue) { _String column1 = x; _Single expr = (_Single)column1; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(column1, typeof(String), typeof(Single?)); expr.VerifyEval(expectedValue); }
private void TestFromDecimal(Decimal?x, Single?expectedValue) { _Decimal column1 = x; _Single expr = (_Single)column1; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(column1, typeof(Decimal?), typeof(Single?)); expr.VerifyEval(expectedValue); }
private void TestFromInt32(Int32?x, Single?expectedValue) { _Int32 column1 = x; _Single expr = (_Single)column1; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(column1, typeof(Int32?), typeof(Single?)); expr.VerifyEval(expectedValue); }
private void TestSubstract(Single?x, Single?y, Single?expectedValue) { _Single column1 = x; _Single column2 = y; var expr = column1 - column2; var dbExpr = (DbBinaryExpression)expr.DbExpression; dbExpr.Verify(BinaryExpressionKind.Substract, column1, column2); expr.VerifyEval(expectedValue); }
private void TestNotEqual(Single?x, Single?y, bool?expectedValue) { _Single column1 = x; _Single column2 = y; var expr = column1 != column2; var dbExpr = (DbBinaryExpression)expr.DbExpression; dbExpr.Verify(BinaryExpressionKind.NotEqual, column1, column2); expr.VerifyEval(expectedValue); }
private void TestGreaterThan(Single?x, Single?y, bool?expectedValue) { _Single column1 = x; _Single column2 = y; var expr = column1 > column2; var dbExpr = (DbBinaryExpression)expr.DbExpression; dbExpr.Verify(BinaryExpressionKind.GreaterThan, column1, column2); expr.VerifyEval(expectedValue); }
private void TestMultiply(Single?x, Single?y, Single?expectedValue) { _Single column1 = x; _Single column2 = y; var expr = column1 * column2; var dbExpr = (DbBinaryExpression)expr.DbExpression; dbExpr.Verify(BinaryExpressionKind.Multiply, column1, column2); expr.VerifyEval(expectedValue); }
private void TestConst(Single?x) { _Single column = _Single.Const(x); column.VerifyConst(x); }
private void TestImplicit(Single?x) { _Single column = x; column.VerifyParam(x); }
/// <summary>Creates a column of parameter expression.</summary> /// <param name="x">The value of the parameter expression.</param> /// <param name="sourceColumn">The value which will be passed to <see cref="DbParamExpression.SourceColumn"/>.</param> /// <returns>The column of parameter expression.</returns> public static _Single Param(Single?x, _Single sourceColumn = null) { return(new ParamExpression <Single?>(x, sourceColumn).MakeColumn <_Single>()); }