예제 #1
0
        public void SoqlDynamicInsert()
        {
            using (SoodaTransaction tran = new SoodaTransaction())
            {
                AddIntField(tran);
                PKInt32 o = new PKInt32();
                try
                {
                    o.Parent    = o;
                    o[IntField] = 42;
                    PKInt32List pl = PKInt32.GetList(new SoqlBooleanRelationalExpression(new SoqlPathExpression(IntField), new SoqlLiteralExpression(5), SoqlRelationalOperator.Equal));
                    CollectionAssert.IsEmpty(pl);

                    pl = PKInt32.GetList(new SoqlBooleanRelationalExpression(new SoqlPathExpression(IntField), new SoqlLiteralExpression(42), SoqlRelationalOperator.Equal));
                    CollectionAssert.AreEquivalent(new PKInt32[] { o }, pl);
                }
                finally
                {
                    o.MarkForDelete();
                    Remove(IntField, tran);
                }
            }
        }
예제 #2
0
        public void SoqlWrapperDynamicInsert()
        {
            using (SoodaTransaction tran = new SoodaTransaction())
            {
                AddIntField(tran);
                PKInt32 o = new PKInt32();
                try
                {
                    o.Parent    = o;
                    o[IntField] = 42;
                    PKInt32List pl = PKInt32.GetList(new SoqlInt32WrapperExpression(new SoqlPathExpression(IntField)) == 5);
                    CollectionAssert.IsEmpty(pl);

                    pl = PKInt32.GetList(new SoqlInt32WrapperExpression(new SoqlPathExpression(IntField)) == 42);
                    CollectionAssert.AreEquivalent(new PKInt32[] { o }, pl);
                }
                finally
                {
                    o.MarkForDelete();
                    Remove(IntField, tran);
                }
            }
        }
예제 #3
0
        public void SoodaWhereClauseDynamicInsert()
        {
            using (SoodaTransaction tran = new SoodaTransaction())
            {
                AddIntField(tran);
                PKInt32 o = new PKInt32();
                try
                {
                    o.Parent    = o;
                    o[IntField] = 42;
                    PKInt32List pl = PKInt32.GetList(new SoodaWhereClause("IntDynamicField = 5"));
                    CollectionAssert.IsEmpty(pl);

                    pl = PKInt32.GetList(new SoodaWhereClause("IntDynamicField = 42"));
                    CollectionAssert.AreEquivalent(new PKInt32[] { o }, pl);
                }
                finally
                {
                    o.MarkForDelete();
                    Remove(IntField, tran);
                }
            }
        }