コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
        private static void TestConst(Decimal?x)
        {
            _Decimal column = _Decimal.Const(x);

            column.VerifyConst(x);
        }
コード例 #12
0
        private static void TestImplicit(Decimal?x)
        {
            _Decimal column = x;

            column.VerifyParam(x);
        }
コード例 #13
0
ファイル: _Decimal.cs プロジェクト: xydoublez/RDO.Net
 /// <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>());
 }