private void TestFromDecimal(Decimal?x, Double?expectedValue) { _Decimal column1 = x; _Double expr = (_Double)column1; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(column1, typeof(Decimal?), typeof(Double?)); expr.VerifyEval(expectedValue); }
private void TestFromDecimal(Decimal?x, Int32?expectedValue) { _Decimal column1 = x; _Int32 expr = (_Int32)column1; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(column1, typeof(Decimal?), typeof(Int32?)); expr.VerifyEval(expectedValue); }
private void TestNegate(Decimal?x, Decimal?expectedValue) { _Decimal column = x; var expr = -column; var dbExpr = (DbUnaryExpression)expr.DbExpression; dbExpr.Verify(DbUnaryExpressionKind.Negate, column); expr.VerifyEval(expectedValue); }
private void TestCastToString(Decimal?x, String expectedValue) { _Decimal column1 = x; _String expr = (_String)column1; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(column1, typeof(Decimal?), typeof(String)); expr.VerifyEval(expectedValue); }
private void TestFromInt32(Int32?x, Decimal?expectedValue) { _Int32 column1 = x; _Decimal expr = (_Decimal)column1; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(column1, typeof(Int32?), typeof(Decimal?)); expr.VerifyEval(expectedValue); }
private void TestFromString(String x, Decimal?expectedValue) { _String column1 = x; _Decimal expr = (_Decimal)column1; var dbExpr = (DbCastExpression)expr.DbExpression; dbExpr.Verify(column1, typeof(String), typeof(Decimal?)); expr.VerifyEval(expectedValue); }
private void TestSubstract(Decimal?x, Decimal?y, Decimal?expectedValue) { _Decimal column1 = x; _Decimal column2 = y; var expr = column1 - column2; var dbExpr = (DbBinaryExpression)expr.DbExpression; dbExpr.Verify(BinaryExpressionKind.Substract, column1, column2); expr.VerifyEval(expectedValue); }
private void TestNotEqual(Decimal?x, Decimal?y, bool?expectedValue) { _Decimal column1 = x; _Decimal column2 = y; var expr = column1 != column2; var dbExpr = (DbBinaryExpression)expr.DbExpression; dbExpr.Verify(BinaryExpressionKind.NotEqual, column1, column2); expr.VerifyEval(expectedValue); }
private void TestGreaterThan(Decimal?x, Decimal?y, bool?expectedValue) { _Decimal column1 = x; _Decimal column2 = y; var expr = column1 > column2; var dbExpr = (DbBinaryExpression)expr.DbExpression; dbExpr.Verify(BinaryExpressionKind.GreaterThan, column1, column2); expr.VerifyEval(expectedValue); }
private void TestMultiply(Decimal?x, Decimal?y, Decimal?expectedValue) { _Decimal column1 = x; _Decimal column2 = y; var expr = column1 * column2; var dbExpr = (DbBinaryExpression)expr.DbExpression; dbExpr.Verify(BinaryExpressionKind.Multiply, column1, column2); expr.VerifyEval(expectedValue); }
private static void TestConst(Decimal?x) { _Decimal column = _Decimal.Const(x); column.VerifyConst(x); }
private static void TestImplicit(Decimal?x) { _Decimal 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 _Decimal Param(Decimal?x, _Decimal sourceColumn = null) { return(new ParamExpression <Decimal?>(x, sourceColumn).MakeColumn <_Decimal>()); }