Ejemplo n.º 1
0
        public void PropertyExpressionForgetStatic()
        {
            // Forgets to mark the item as static
            var c       = new PropertyExpressionTransformer();
            var f       = new PETest();
            var paccess = Expression.Field(Expression.Constant(f), "theFieldBadStatic");

            var pnew = c.Transform(paccess);
        }
Ejemplo n.º 2
0
        public void PropertyExpressionWrongSignature()
        {
            // Totally wrong signature
            var c       = new PropertyExpressionTransformer();
            var f       = new PETest();
            var paccess = Expression.Field(Expression.Constant(f), "theFieldBadSignature");

            var pnew = c.Transform(paccess);
        }
Ejemplo n.º 3
0
        public void PropertyExpressionWrongReturnType()
        {
            // everything right but return type wrong.
            var c       = new PropertyExpressionTransformer();
            var f       = new PETest();
            var paccess = Expression.Field(Expression.Constant(f), "theFieldBadReturn");

            var pnew = c.Transform(paccess);
        }
Ejemplo n.º 4
0
        public void PropertyExpressionConstant()
        {
            var c       = new PropertyExpressionTransformer();
            var f       = new PETest();
            var paccess = Expression.Property(Expression.Constant(f), "theConstant");

            var pnew = c.Transform(paccess);

            Assert.IsNotNull(pnew);
            Assert.AreEqual("f => 10.Invoke(value(LINQToTTreeLib.Tests.QueryVisitors.PropertyExpressionTransformerTest+PETest))", pnew.ToString());
        }
        public void PropertyExpressionNoReplacementP()
        {
            var c = new PropertyExpressionTransformer();
            var f = new PETest();
            var paccess = Expression.Property(Expression.Constant(f), "thePropertyRaw");

            var pnew = c.Transform(paccess);

            Assert.IsNotNull(pnew);
            Assert.IsInstanceOfType(pnew, typeof(MemberExpression));
            var pnewme = pnew as MemberExpression;
            Assert.AreEqual("thePropertyRaw", pnewme.Member.Name);
        }
Ejemplo n.º 6
0
        public void PropertyExpressionNoReplacementF()
        {
            var c       = new PropertyExpressionTransformer();
            var f       = new PETest();
            var paccess = Expression.Field(Expression.Constant(f), "theFieldRaw");

            var pnew = c.Transform(paccess);

            Assert.IsNotNull(pnew);
            Assert.IsInstanceOfType(pnew, typeof(MemberExpression));
            var pnewme = pnew as MemberExpression;

            Assert.AreEqual("theFieldRaw", pnewme.Member.Name);
        }
        public void PropertyExpressionForgetStatic()
        {
            // Forgets to mark the item as static
            var c = new PropertyExpressionTransformer();
            var f = new PETest();
            var paccess = Expression.Field(Expression.Constant(f), "theFieldBadStatic");

            var pnew = c.Transform(paccess);
        }
        public void PropertyExpressionWrongSignature()
        {
            // Totally wrong signature
            var c = new PropertyExpressionTransformer();
            var f = new PETest();
            var paccess = Expression.Field(Expression.Constant(f), "theFieldBadSignature");

            var pnew = c.Transform(paccess);
        }
        public void PropertyExpressionWrongReturnType()
        {
            // everything right but return type wrong.
            var c = new PropertyExpressionTransformer();
            var f = new PETest();
            var paccess = Expression.Field(Expression.Constant(f), "theFieldBadReturn");

            var pnew = c.Transform(paccess);
        }
        public void PropertyExpressionConstant()
        {
            var c = new PropertyExpressionTransformer();
            var f = new PETest();
            var paccess = Expression.Property(Expression.Constant(f), "theConstant");

            var pnew = c.Transform(paccess);

            Assert.IsNotNull(pnew);
            Assert.AreEqual("f => 10.Invoke(value(LINQToTTreeLib.Tests.QueryVisitors.PropertyExpressionTransformerTest+PETest))", pnew.ToString());
        }